Revision 7e402b46
b/snf-pithos-app/pithos/api/test/__init__.py | ||
---|---|---|
307 | 307 |
return response |
308 | 308 |
|
309 | 309 |
def put(self, url, user='user', token='DummyToken', data={}, |
310 |
content_type='application/octet-stream', follow=False, **extra): |
|
310 |
content_type='application/octet-stream', follow=False, |
|
311 |
quote_extra=True, **extra): |
|
311 | 312 |
with astakos_user(user): |
312 |
extra = dict((quote(k), quote(v)) for k, v in extra.items()) |
|
313 |
if quote_extra: |
|
314 |
extra = dict((quote(k), quote(v)) for k, v in extra.items()) |
|
313 | 315 |
if token: |
314 | 316 |
extra['HTTP_X_AUTH_TOKEN'] = token |
315 | 317 |
response = self.client.put(url, data, content_type, follow, |
b/snf-pithos-app/pithos/api/test/objects.py | ||
---|---|---|
601 | 601 |
for k, v in meta.iteritems()) |
602 | 602 |
headers['HTTP_CONTENT_DISPOSITION'] = 'attachment; filename="%f2"' |
603 | 603 |
url = join_urls(self.pithos_path, self.user, cname, oname) |
604 |
r = self.put(url, data=data, content_type='application/pdf', **headers) |
|
604 |
r = self.put(url, data=data, content_type='application/pdf', |
|
605 |
quote_extra=False, **headers) |
|
605 | 606 |
self.assertEqual(r.status_code, 400) |
606 | 607 |
|
607 | 608 |
headers['HTTP_CONTENT_DISPOSITION'] = ('attachment; filename="%s"' % |
Also available in: Unified diff