Merge "Fix use of invalid assert calls"

This commit is contained in:
Jenkins 2016-06-09 10:27:25 +00:00 committed by Gerrit Code Review
commit a698ca4462
2 changed files with 4 additions and 4 deletions

View File

@ -171,7 +171,7 @@ class ServiceTestCase(test.NoDBTestCase):
serv.start()
# test service version got updated and saved:
service_obj.save.assert_called_once()
self.assertEqual(1, service_obj.save.call_count)
self.assertEqual(objects.service.SERVICE_VERSION, service_obj.version)
def _test_service_check_create_race(self, ex):

View File

@ -15302,7 +15302,7 @@ class LibvirtDriverTestCase(test.NoDBTestCase):
# cache() should have been called on the 3 disk backends
for backend in (mock_backend.kernel, mock_backend.ramdisk,
mock_backend.root):
backend.cache.assert_called()
self.assertTrue(backend.cache.called)
@mock.patch.object(libvirt_utils, 'get_instance_path')
@mock.patch.object(libvirt_utils, 'load_file')
@ -15424,10 +15424,10 @@ class LibvirtDriverTestCase(test.NoDBTestCase):
# cache() should habe been called on the 3 non-config disk backends
for backend in (mock_backend.kernel, mock_backend.ramdisk,
mock_backend.root):
backend.cache.assert_called()
self.assertTrue(backend.cache.called)
# import_file() should have been called for the config disk
mock_backend.config.import_file.assert_called()
self.assertTrue(mock_backend.config.import_file.called)
@mock.patch('shutil.rmtree')
@mock.patch('nova.utils.execute')