本文整理匯總了Python中bindep.depends.Depends.list_all_packages方法的典型用法代碼示例。如果您正苦於以下問題:Python Depends.list_all_packages方法的具體用法?Python Depends.list_all_packages怎麽用?Python Depends.list_all_packages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類bindep.depends.Depends
的用法示例。
在下文中一共展示了Depends.list_all_packages方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_list_all
# 需要導入模塊: from bindep.depends import Depends [as 別名]
# 或者: from bindep.depends.Depends import list_all_packages [as 別名]
def test_list_all(self):
depends = Depends(dedent("""\
install1
install2 [test]
install3 [platform:rpm]
install4 [platform:dpkg]
install5 [quark]
install6 [platform:dpkg test]
install7 [quark test]
install8 [platform:dpkg platform:rpm]
install9 [platform:dpkg platform:rpm test]
installA [!platform:dpkg]
installB [!platform:dpkg test]
installC [!platform:dpkg !test]
installD [platform:dpkg !test]
installE [platform:dpkg !platform:rpm]
installF [platform:dpkg !platform:rpm test]
installG [!platform:dpkg !platform:rpm]
installH [!platform:dpkg !platform:rpm test]
installI [!platform:dpkg !platform:rpm !test]
installJ [platform:dpkg !platform:rpm !test]
"""))
rules_dpkg = depends.active_rules(['platform:dpkg'])
result_dpkg = set(r[0] for r in rules_dpkg)
self.assertEqual(result_dpkg,
set(depends.list_all_packages(rules_dpkg,
output_format='newline')))
self.assertEqual(result_dpkg,
set(depends.list_all_packages(rules_dpkg,
output_format='csv')))
rules_dpkg_test = depends.active_rules(['platform:dpkg', 'test'])
result_dpkg_test = set(r[0] for r in rules_dpkg_test)
self.assertEqual(result_dpkg_test, set(depends.list_all_packages(
rules_dpkg_test,
output_format='newline')))
self.assertEqual(result_dpkg_test, set(depends.list_all_packages(
rules_dpkg_test,
output_format='csv')))
rules_rpm = depends.active_rules(['platform:rpm'])
result_rpm = set(r[0] for r in rules_rpm)
self.assertEqual(result_rpm, set(depends.list_all_packages(rules_rpm,
output_format='newline')))
self.assertEqual(result_rpm, set(depends.list_all_packages(rules_rpm,
output_format='csv')))
rules_rpm_test = depends.active_rules(['platform:rpm', 'test'])
result_rpm_test = set(r[0] for r in rules_rpm_test)
self.assertEqual(result_rpm_test,
set(depends.list_all_packages(
rules_rpm_test,
output_format='newline')))
self.assertEqual(result_rpm_test,
set(depends.list_all_packages(
rules_rpm_test,
output_format='csv')))