diff options
author | Mike Fedosin <mfedosin@mirantis.com> | 2015-07-10 18:55:46 +0300 |
---|---|---|
committer | Mike Fedosin <mfedosin@mirantis.com> | 2015-07-10 18:55:46 +0300 |
commit | ec025eb9e5502d9111b32dc5360a4bd5d9aff8eb (patch) | |
tree | dec00ca0982cc587849e550c77bcb75f9fe7b88b | |
parent | 1ee5b957643eec4a5b3e43710211b4be9c8eae64 (diff) | |
download | glance_store-ec025eb9e5502d9111b32dc5360a4bd5d9aff8eb.tar.gz |
Remove usage of assert_called_once in mocks
This was never a real part of the mock api, but mock was happily mocking
it out and letting the tests pass. The new mock release made this
behaviour break, causing tests to fail on all patches. This patch
replaces instances of assert_called_once with an assert of the mock's
call_count.
Change-Id: I41ea0456acda86147ce3a7da0311e926782b4542
Closes-Bug: #1473369
-rw-r--r-- | glance_store/tests/unit/test_swift_store.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/glance_store/tests/unit/test_swift_store.py b/glance_store/tests/unit/test_swift_store.py index f4b8781..b322576 100644 --- a/glance_store/tests/unit/test_swift_store.py +++ b/glance_store/tests/unit/test_swift_store.py @@ -830,7 +830,7 @@ class SwiftTests(object): loc = location.get_location_from_uri(uri, conf=self.conf) self.store.delete(loc) - mock_del_obj.assert_called_once() + self.assertEqual(1, mock_del_obj.call_count) _, kwargs = mock_del_obj.call_args self.assertEqual('multipart-manifest=delete', kwargs.get('query_string')) @@ -851,7 +851,7 @@ class SwiftTests(object): loc = location.get_location_from_uri(uri, conf=self.conf) self.store.delete(loc) - mock_del_obj.assert_called_once() + self.assertEqual(1, mock_del_obj.call_count) _, kwargs = mock_del_obj.call_args self.assertEqual(None, kwargs.get('query_string')) |