本文整理汇总了Python中pcs.lib.env.LibraryEnvironment.get_cib方法的典型用法代码示例。如果您正苦于以下问题:Python LibraryEnvironment.get_cib方法的具体用法?Python LibraryEnvironment.get_cib怎么用?Python LibraryEnvironment.get_cib使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pcs.lib.env.LibraryEnvironment
的用法示例。
在下文中一共展示了LibraryEnvironment.get_cib方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_cib_no_version_live
# 需要导入模块: from pcs.lib.env import LibraryEnvironment [as 别名]
# 或者: from pcs.lib.env.LibraryEnvironment import get_cib [as 别名]
def test_get_cib_no_version_live(
self, mock_get_cib_xml, mock_ensure_cib_version
):
mock_get_cib_xml.return_value = '<cib/>'
env = LibraryEnvironment(self.mock_logger, self.mock_reporter)
assert_xml_equal('<cib/>', etree.tostring(env.get_cib()).decode())
self.assertEqual(1, mock_get_cib_xml.call_count)
self.assertEqual(0, mock_ensure_cib_version.call_count)
self.assertFalse(env.cib_upgraded)
示例2: test_get_cib_upgrade_live
# 需要导入模块: from pcs.lib.env import LibraryEnvironment [as 别名]
# 或者: from pcs.lib.env.LibraryEnvironment import get_cib [as 别名]
def test_get_cib_upgrade_live(
self, mock_get_cib_xml, mock_ensure_cib_version
):
mock_get_cib_xml.return_value = '<cib/>'
mock_ensure_cib_version.return_value = etree.XML('<new_cib/>')
env = LibraryEnvironment(self.mock_logger, self.mock_reporter)
assert_xml_equal(
'<new_cib/>', etree.tostring(env.get_cib((1, 2, 3))).decode()
)
self.assertEqual(1, mock_get_cib_xml.call_count)
self.assertEqual(1, mock_ensure_cib_version.call_count)
self.assertTrue(env.cib_upgraded)
示例3: test_get_cib_upgrade_live
# 需要导入模块: from pcs.lib.env import LibraryEnvironment [as 别名]
# 或者: from pcs.lib.env.LibraryEnvironment import get_cib [as 别名]
def test_get_cib_upgrade_live(
self, mock_get_cib_xml, mock_ensure_cib_version
):
mock_get_cib_xml.return_value = '<cib/>'
mock_ensure_cib_version.return_value = etree.XML('<new_cib/>')
env = LibraryEnvironment(self.mock_logger, self.mock_reporter)
assert_xml_equal(
'<new_cib/>', etree.tostring(env.get_cib((1, 2, 3))).decode()
)
self.assertEqual(1, mock_get_cib_xml.call_count)
self.assertEqual(1, mock_ensure_cib_version.call_count)
assert_report_item_list_equal(
env.report_processor.report_item_list,
[(
severity.INFO,
report_codes.CIB_UPGRADE_SUCCESSFUL,
{}
)]
)
self.assertTrue(env.cib_upgraded)