Commit 5c2058e7 authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Allow upload_from_string to use content-encoding

parent ecf0fc97
......@@ -445,7 +445,7 @@ class PithosClient(PithosRestClient):
try:
details = ['%s' % thread.exception for thread in missing]
except Exception:
details = []
details = ['Also, failed to read thread exceptions']
raise ClientError(
'%s blocks failed to upload' % len(missing),
details=details)
......@@ -596,6 +596,7 @@ class PithosClient(PithosRestClient):
format='json',
hashmap=True,
content_type=content_type,
content_encoding=content_encoding,
if_etag_match=if_etag_match,
if_etag_not_match='*' if if_not_exist else None,
etag=etag,
......
......@@ -1028,7 +1028,8 @@ class PithosClient(TestCase):
tmpFile.seek(0)
ctype = 'video/mpeg'
sharing = dict(read=['u1', 'g1', 'u2'], write=['u1'])
r = self.client.upload_object(obj, tmpFile,
r = self.client.upload_object(
obj, tmpFile,
content_type=ctype, sharing=sharing)
self.assert_dicts_are_equal(r, exp_headers)
self.assertEqual(OP.mock_calls[-1][2]['content_type'], ctype)
......
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