Merge "libvirt: fix missed test in migration"

This commit is contained in:
Jenkins 2016-07-28 19:26:22 +00:00 committed by Gerrit Code Review
commit 633ed09f23
1 changed files with 3 additions and 1 deletions

View File

@ -78,12 +78,13 @@ class UtilityMigrationTestCase(test.NoDBTestCase):
self.assertIsNone(addr)
@mock.patch('lxml.etree.tostring')
@mock.patch.object(migration, '_update_perf_events_xml')
@mock.patch.object(migration, '_update_graphics_xml')
@mock.patch.object(migration, '_update_serial_xml')
@mock.patch.object(migration, '_update_volume_xml')
def test_get_updated_guest_xml(
self, mock_volume, mock_serial, mock_graphics,
mock_tostring):
mock_perf_events_xml, mock_tostring):
data = objects.LibvirtLiveMigrateData()
mock_guest = mock.Mock(spec=libvirt_guest.Guest)
get_volume_config = mock.MagicMock()
@ -93,6 +94,7 @@ class UtilityMigrationTestCase(test.NoDBTestCase):
mock_graphics.assert_called_once_with(mock.ANY, data)
mock_serial.assert_called_once_with(mock.ANY, data)
mock_volume.assert_called_once_with(mock.ANY, data, get_volume_config)
mock_perf_events_xml.assert_called_once_with(mock.ANY, data)
self.assertEqual(1, mock_tostring.called)
def test_update_serial_xml_serial(self):