Merge "Test: use assert_has_calls() instead"
This commit is contained in:
@@ -686,9 +686,12 @@ class ShellCacheSchemaTest(testutils.TestCase):
|
|||||||
self.shell._cache_schemas(self._make_args(options),
|
self.shell._cache_schemas(self._make_args(options),
|
||||||
client, home_dir=self.cache_dir)
|
client, home_dir=self.cache_dir)
|
||||||
|
|
||||||
os.path.exists.assert_any_call(self.prefix_path)
|
exists_mock.assert_has_calls([
|
||||||
os.path.exists.assert_any_call(self.cache_files[0])
|
mock.call(self.prefix_path),
|
||||||
os.path.exists.assert_any_call(self.cache_files[1])
|
mock.call(self.cache_files[0]),
|
||||||
|
mock.call(self.cache_files[1]),
|
||||||
|
mock.call(self.cache_files[2])
|
||||||
|
])
|
||||||
self.assertEqual(4, exists_mock.call_count)
|
self.assertEqual(4, exists_mock.call_count)
|
||||||
self.assertEqual(0, open.mock_calls.__len__())
|
self.assertEqual(0, open.mock_calls.__len__())
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user