Commit fdc788a8 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

pithos: Fix test

parent 95a5057d
......@@ -307,9 +307,11 @@ class PithosAPITest(TestCase):
return response
def put(self, url, user='user', token='DummyToken', data={},
content_type='application/octet-stream', follow=False, **extra):
content_type='application/octet-stream', follow=False,
quote_extra=True, **extra):
with astakos_user(user):
extra = dict((quote(k), quote(v)) for k, v in extra.items())
if quote_extra:
extra = dict((quote(k), quote(v)) for k, v in extra.items())
if token:
extra['HTTP_X_AUTH_TOKEN'] = token
response = self.client.put(url, data, content_type, follow,
......@@ -601,7 +601,8 @@ class ObjectPut(PithosAPITest):
for k, v in meta.iteritems())
headers['HTTP_CONTENT_DISPOSITION'] = 'attachment; filename="%f2"'
url = join_urls(self.pithos_path, self.user, cname, oname)
r = self.put(url, data=data, content_type='application/pdf', **headers)
r = self.put(url, data=data, content_type='application/pdf',
quote_extra=False, **headers)
self.assertEqual(r.status_code, 400)
headers['HTTP_CONTENT_DISPOSITION'] = ('attachment; filename="%s"' %
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment