示例#1
0
文件: test_conf.py 项目: cretta/trove
    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()
示例#2
0
    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()
示例#3
0
    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()