

@mock.patch.object(compute_rpcapi.ComputeAPI, 'get_console_topic', return_value='compute.fake_host')
@mock.patch.object(objects.Instance, 'get_by_uuid')
def test_create_console(self, mock_get_instance_by_uuid, mock_get_console_topic):
    mock_get_instance_by_uuid.return_value = objects.Instance(**self.fake_instance)
    self.console_api.create_console(self.context, self.fake_uuid)
    mock_get_console_topic.assert_called_once_with(mock_get_instance_by_uuid.context, 'fake_host')

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/console/test_console.py ConsoleAPITestCase.test_create_console/VarMisuse@79/139 `self`->`mock_get_instance_by_uuid`