当前位置: 首页>>代码示例>>Python>>正文


Python LibraryEnvironment.cmd_runner方法代码示例

本文整理汇总了Python中pcs.lib.env.LibraryEnvironment.cmd_runner方法的典型用法代码示例。如果您正苦于以下问题:Python LibraryEnvironment.cmd_runner方法的具体用法?Python LibraryEnvironment.cmd_runner怎么用?Python LibraryEnvironment.cmd_runner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pcs.lib.env.LibraryEnvironment的用法示例。


在下文中一共展示了LibraryEnvironment.cmd_runner方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_cmd_runner_no_options

# 需要导入模块: from pcs.lib.env import LibraryEnvironment [as 别名]
# 或者: from pcs.lib.env.LibraryEnvironment import cmd_runner [as 别名]
 def test_cmd_runner_no_options(self, mock_runner):
     expected_runner = mock.MagicMock()
     mock_runner.return_value = expected_runner
     env = LibraryEnvironment(self.mock_logger, self.mock_reporter)
     runner = env.cmd_runner()
     self.assertEqual(expected_runner, runner)
     mock_runner.assert_called_once_with(
         self.mock_logger,
         self.mock_reporter,
         {}
     )
开发者ID:idevat,项目名称:pcs,代码行数:13,代码来源:test_lib_env.py

示例2: PushCib

# 需要导入模块: from pcs.lib.env import LibraryEnvironment [as 别名]
# 或者: from pcs.lib.env.LibraryEnvironment import cmd_runner [as 别名]
class PushCib(TestCase):
    def setUp(self):
        self.env = LibraryEnvironment(
            mock.MagicMock(logging.Logger),
            MockLibraryReportProcessor()
        )

    def test_run_only_push_when_without_wait(self, wait_for_idle, push_cib_xml):
        self.env.push_cib(etree.fromstring("<cib/>"))
        push_cib_xml.assert_called_once_with("<cib/>")
        wait_for_idle.assert_not_called()

    def test_run_wait_when_wait_specified(self, wait_for_idle, push_cib_xml):
        self.env.push_cib(etree.fromstring("<cib/>"), 10)
        push_cib_xml.assert_called_once_with("<cib/>")
        wait_for_idle.assert_called_once_with(self.env.cmd_runner(), 10)
开发者ID:HideoYamauchi,项目名称:pcs,代码行数:18,代码来源:test_lib_env.py

示例3: test_cmd_runner_all_options

# 需要导入模块: from pcs.lib.env import LibraryEnvironment [as 别名]
# 或者: from pcs.lib.env.LibraryEnvironment import cmd_runner [as 别名]
 def test_cmd_runner_all_options(self, mock_runner):
     expected_runner = mock.MagicMock()
     mock_runner.return_value = expected_runner
     user = "testuser"
     env = LibraryEnvironment(
         self.mock_logger,
         self.mock_reporter,
         user_login=user
     )
     runner = env.cmd_runner()
     self.assertEqual(expected_runner, runner)
     mock_runner.assert_called_once_with(
         self.mock_logger,
         self.mock_reporter,
         {"CIB_user": user}
     )
开发者ID:idevat,项目名称:pcs,代码行数:18,代码来源:test_lib_env.py

示例4: test_dump_cib_file

# 需要导入模块: from pcs.lib.env import LibraryEnvironment [as 别名]
# 或者: from pcs.lib.env.LibraryEnvironment import cmd_runner [as 别名]
 def test_dump_cib_file(self, mock_tmpfile, mock_runner):
     expected_runner = mock.MagicMock()
     mock_runner.return_value = expected_runner
     mock_instance = mock.MagicMock()
     mock_instance.name = rc("file.tmp")
     mock_tmpfile.return_value = mock_instance
     env = LibraryEnvironment(
         self.mock_logger,
         self.mock_reporter,
         cib_data="<cib />"
     )
     runner = env.cmd_runner()
     self.assertEqual(expected_runner, runner)
     mock_runner.assert_called_once_with(
         self.mock_logger,
         self.mock_reporter,
         {
             "LC_ALL": "C",
             "CIB_file": rc("file.tmp"),
         }
     )
     mock_tmpfile.assert_called_once_with("<cib />")
开发者ID:tomjelinek,项目名称:pcs,代码行数:24,代码来源:test_env.py


注:本文中的pcs.lib.env.LibraryEnvironment.cmd_runner方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。