@mock.patch('mutornadomon.config.MuTornadoMon')
    @mock.patch('mutornadomon.config.WebCollector')
    @mock.patch('mutornadomon.config.UtilizationCollector')
    def test_initialize_mutornadmon(self, utilization_collector_mock, web_collector_mock, mutornadomon_mock):
        app = sentinel.application,
        result = initialize_mutornadomon(app, host_limit='test')
        monitor_inst = mutornadomon_mock.return_value

        # initialize_mutornadomon() should return the monitor instance
        self.assertEqual(result, monitor_inst)

        assert mutornadomon_mock.call_count == 1
        web_collector_mock.assert_called_once_with(monitor_inst, app)
        utilization_collector_mock.assert_called_once_with(monitor_inst)

        # MuTornadoMon was created with monitor config values
        arg_list = mutornadomon_mock.call_args_list

        self.assertEquals(len(arg_list), 1)
        args, kwargs = arg_list[0]
        self.assertEqual(len(args), 1)
        self.assertTrue(isinstance(args[0], HTTPEndpointExternalInterface))

        self.assertEqual(kwargs, {})
Get reference to the VM through uuid or vm name.
dataset/ETHPy150Open uber/mutornadomon/tests/test_config.py/TestInitializeMutornadomon.test_initialize_mutornadmon--crossover with--dataset/ETHPy150Open openstack/nova/nova/virt/vmwareapi/vm_util.py/get_vm_ref