summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-09-14 20:46:57 +0000
committerGerrit Code Review <review@openstack.org>2016-09-14 20:46:57 +0000
commit714bf0cd4b1fafc47d055ccc12edd4a51ed8cb91 (patch)
tree840f04a8871ccc40c0f76d64ab1c8c56d8416391 /tests
parentb679959d35518818b01f8c5df44ce56e1c214ac2 (diff)
parent209677e6a8afeba048cca62b0383661052f7db2b (diff)
downloadpython-swiftclient-714bf0cd4b1fafc47d055ccc12edd4a51ed8cb91.tar.gz
Merge "Fix intermittent test failure"
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_shell.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/unit/test_shell.py b/tests/unit/test_shell.py
index 3f077dc..33e297d 100644
--- a/tests/unit/test_shell.py
+++ b/tests/unit/test_shell.py
@@ -1328,8 +1328,8 @@ class TestShell(unittest.TestCase):
fresh_metadata=False, headers={'X-Object-Meta-Color': 'Blue'},
response_dict={})
]
- for call in calls:
- self.assertIn(call, connection.return_value.copy_object.mock_calls)
+ connection.return_value.copy_object.assert_has_calls(
+ calls, any_order=True)
self.assertEqual(len(connection.return_value.copy_object.mock_calls),
len(calls))
@@ -1337,6 +1337,7 @@ class TestShell(unittest.TestCase):
def test_copy_two_objects_destination(self, connection):
argv = ["", "copy", "container", "object", "object2",
"--meta", "Color:Blue", "--destination", "/c"]
+ connection.return_value.copy_object.return_value = None
swiftclient.shell.main(argv)
calls = [
mock.call(
@@ -1348,7 +1349,10 @@ class TestShell(unittest.TestCase):
fresh_metadata=False, headers={'X-Object-Meta-Color': 'Blue'},
response_dict={})
]
- connection.return_value.copy_object.assert_has_calls(calls)
+ connection.return_value.copy_object.assert_has_calls(
+ calls, any_order=True)
+ self.assertEqual(len(connection.return_value.copy_object.mock_calls),
+ len(calls))
@mock.patch('swiftclient.service.Connection')
def test_copy_two_objects_bad_destination(self, connection):