diff options
| author | Zuul <zuul@review.openstack.org> | 2017-12-08 19:51:05 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2017-12-08 19:51:05 +0000 |
| commit | cde257de5cdfd1d0f5c832e154a7dee9cd42f13f (patch) | |
| tree | 4290d658331f5cf293db5e18ac9cbe2360150dff /tests | |
| parent | cb2778659e8d69d8741ca3167314862f8555a989 (diff) | |
| parent | 484d7ee9b21396d066604e8e876ffb3d6ed6d359 (diff) | |
| download | python-swiftclient-cde257de5cdfd1d0f5c832e154a7dee9cd42f13f.tar.gz | |
Merge "Allow --meta on upload"
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit/test_service.py | 35 | ||||
| -rw-r--r-- | tests/unit/test_shell.py | 6 |
2 files changed, 13 insertions, 28 deletions
diff --git a/tests/unit/test_service.py b/tests/unit/test_service.py index 54f0a11..5ccc081 100644 --- a/tests/unit/test_service.py +++ b/tests/unit/test_service.py @@ -1146,14 +1146,9 @@ class TestServiceUpload(_TestServiceBase): container='test_c', source=f.name, obj='ใในใ/dummy.dat', - options={'changed': False, - 'skip_identical': False, - 'leave_segments': True, - 'header': '', - 'segment_size': 10, - 'segment_container': None, - 'use_slo': False, - 'checksum': True}) + options=dict(s._options, + segment_size=10, + leave_segments=True)) mtime = r['headers']['x-object-meta-mtime'] self.assertEqual(expected_mtime, mtime) @@ -1350,12 +1345,8 @@ class TestServiceUpload(_TestServiceBase): container='test_c', source=f.name, obj='test_o', - options={'changed': False, - 'skip_identical': False, - 'leave_segments': True, - 'header': '', - 'segment_size': 0, - 'checksum': True}) + options=dict(s._options, + leave_segments=True)) mtime = r['headers']['x-object-meta-mtime'] self.assertEqual(expected_mtime, mtime) @@ -1405,12 +1396,8 @@ class TestServiceUpload(_TestServiceBase): container='test_c', source=f, obj='test_o', - options={'changed': False, - 'skip_identical': False, - 'leave_segments': True, - 'header': '', - 'segment_size': 0, - 'checksum': True}) + options=dict(s._options, + leave_segments=True)) mtime = float(r['headers']['x-object-meta-mtime']) self.assertEqual(mtime, expected_mtime) @@ -1452,12 +1439,8 @@ class TestServiceUpload(_TestServiceBase): container='test_c', source=f.name, obj='test_o', - options={'changed': False, - 'skip_identical': False, - 'leave_segments': True, - 'header': '', - 'segment_size': 0, - 'checksum': True}) + options=dict(s._options, + leave_segments=True)) self.assertIs(r['success'], False) self.assertIn('md5 mismatch', str(r.get('error'))) diff --git a/tests/unit/test_shell.py b/tests/unit/test_shell.py index 2e20a87..110fb01 100644 --- a/tests/unit/test_shell.py +++ b/tests/unit/test_shell.py @@ -624,7 +624,8 @@ class TestShell(unittest.TestCase): connection.return_value.put_object.return_value = EMPTY_ETAG connection.return_value.attempts = 0 argv = ["", "upload", "container", self.tmpfile, - "-H", "X-Storage-Policy:one"] + "-H", "X-Storage-Policy:one", + "--meta", "Color:Blue"] swiftclient.shell.main(argv) connection.return_value.put_container.assert_called_once_with( 'container', @@ -637,7 +638,8 @@ class TestShell(unittest.TestCase): mock.ANY, content_length=0, headers={'x-object-meta-mtime': mock.ANY, - 'X-Storage-Policy': 'one'}, + 'X-Storage-Policy': 'one', + 'X-Object-Meta-Color': 'Blue'}, response_dict={}) # upload to pseudo-folder (via <container> param) |
