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


Python LibraryEnvironment.push_cib方法代码示例

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


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

示例1: test_push_cib_not_upgraded_live

# 需要导入模块: from pcs.lib.env import LibraryEnvironment [as 别名]
# 或者: from pcs.lib.env.LibraryEnvironment import push_cib [as 别名]
 def test_push_cib_not_upgraded_live(self, mock_replace_cib):
     env = LibraryEnvironment(self.mock_logger, self.mock_reporter)
     env.push_cib(etree.XML('<cib/>'))
     mock_replace_cib.assert_called_once_with(
         "mock cmd runner", '<cib/>', False
     )
     self.assertEqual([], env.report_processor.report_item_list)
开发者ID:idevat,项目名称:pcs,代码行数:9,代码来源:test_lib_env.py

示例2: test_push_cib_upgraded_live

# 需要导入模块: from pcs.lib.env import LibraryEnvironment [as 别名]
# 或者: from pcs.lib.env.LibraryEnvironment import push_cib [as 别名]
 def test_push_cib_upgraded_live(self, mock_replace_cib):
     env = LibraryEnvironment(self.mock_logger, self.mock_reporter)
     env._cib_upgraded = True
     env.push_cib(etree.XML('<cib/>'))
     mock_replace_cib.assert_called_once_with(
         "mock cmd runner",
         '<cib/>'
     )
     self.assertFalse(env.cib_upgraded)
开发者ID:HideoYamauchi,项目名称:pcs,代码行数:11,代码来源:test_lib_env.py

示例3: test_push_cib_upgraded_live

# 需要导入模块: from pcs.lib.env import LibraryEnvironment [as 别名]
# 或者: from pcs.lib.env.LibraryEnvironment import push_cib [as 别名]
 def test_push_cib_upgraded_live(self, mock_replace_cib):
     env = LibraryEnvironment(self.mock_logger, self.mock_reporter)
     env._cib_upgraded = True
     env.push_cib(etree.XML('<cib/>'))
     mock_replace_cib.assert_called_once_with(
         "mock cmd runner", '<cib/>', True
     )
     assert_report_item_list_equal(
         env.report_processor.report_item_list,
         [(
             severity.INFO,
             report_codes.CIB_UPGRADE_SUCCESSFUL,
             {}
         )]
     )
开发者ID:idevat,项目名称:pcs,代码行数:17,代码来源:test_lib_env.py

示例4: PushCib

# 需要导入模块: from pcs.lib.env import LibraryEnvironment [as 别名]
# 或者: from pcs.lib.env.LibraryEnvironment import push_cib [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


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