def _test_manager(self, conf, rt_mgr_name): def mock_launch(server, workers): qualified_mgr = "%s.%s" % (server.manager_impl.__module__, server.manager_impl.__class__.__name__) self.assertEqual(rt_mgr_name, qualified_mgr, "Invalid manager") return MagicMock() os_service.launch = mock_launch with patch.object(common_cmd, "initialize", MagicMock(return_value=conf)): conductor_cmd.main()
def _test_manager(self, conf, rt_mgr_name): def mock_launch(server, workers): qualified_mgr = "%s.%s" % (server.manager_impl.__module__, server.manager_impl.__class__.__name__) self.assertEqual(rt_mgr_name, qualified_mgr, "Invalid manager") return mock.MagicMock() os_service.launch = mock_launch common_cmd.initialize = mock.MagicMock(return_value=conf) conductor_cmd.main()
def _test_manager(self, conf, rt_mgr_name): def mock_launch(conf, server, workers, restart_method): qualified_mgr = "%s.%s" % (server.manager_impl.__module__, server.manager_impl.__class__.__name__) self.assertEqual(rt_mgr_name, qualified_mgr, "Invalid manager") return MagicMock() os_service.launch = mock_launch with patch.object(common_cmd, 'initialize', MagicMock(return_value=conf)): conductor_cmd.main()