Fix call to mock.assert_not_called()

There is no assert_not_called() method in mock, as described here:
https://code.google.com/p/mock/issues/detail?id=159
Fix the call to use the mock.called attribute instead.

Change-Id: I4b37764ac65736934fe3448bc50520bcd84ff61d
This commit is contained in:
ChangBo Guo(gcb) 2014-05-14 13:48:32 +08:00
parent 1cebc193ba
commit facdfa0341
1 changed files with 3 additions and 2 deletions

View File

@ -184,9 +184,10 @@ class TestMigrationCommon(test_base.DbTestCase):
) as (mock_find_repo, mock_sanity, mock_downgrade):
mock_find_repo.return_value = self.return_value
migration.db_sync(self.engine, self.path, self.test_version, False)
migration.db_sync(self.engine, self.path, self.test_version,
sanity_check=False)
mock_sanity.assert_not_called()
self.assertFalse(mock_sanity.called)
def test_db_sanity_table_not_utf8(self):
with mock.patch.object(self, 'engine') as mock_eng: