本文整理汇总了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)
示例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)
示例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,
{}
)]
)
示例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)