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
This commit is contained in:
Mike Fedosin 2015-07-10 18:55:46 +03:00 committed by Gorka Eguileor
parent d9b197b6d6
commit 652a5bb434
1 changed files with 2 additions and 2 deletions

View File

@ -827,7 +827,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'))
@ -848,7 +848,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'))