本文整理汇总了Python中bindep.depends.Depends.platform_profiles方法的典型用法代码示例。如果您正苦于以下问题:Python Depends.platform_profiles方法的具体用法?Python Depends.platform_profiles怎么用?Python Depends.platform_profiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bindep.depends.Depends
的用法示例。
在下文中一共展示了Depends.platform_profiles方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_detects_opensuse_leap15
# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform_profiles [as 别名]
def test_detects_opensuse_leap15(self):
with DistroFixture("openSUSEleap15"):
depends = Depends("")
platform_profiles = depends.platform_profiles()
self.assertThat(platform_profiles,
Contains("platform:opensuse"))
self.assertThat(platform_profiles,
Contains("platform:suse"))
示例2: test_detects_unknown
# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform_profiles [as 别名]
def test_detects_unknown(self):
with DistroFixture("Unknown"):
depends = Depends("")
self.assertThat(
depends.platform_profiles(), Contains("platform:unknown"))
with ExpectedException(Exception,
"Uknown package manager for "
"current platform."):
depends.platform.get_pkg_version('x')
示例3: test_detects_rhel_workstation
# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform_profiles [as 别名]
def test_detects_rhel_workstation(self):
with DistroFixture("RHELWorkstation"):
depends = Depends("")
platform_profiles = depends.platform_profiles()
self.assertThat(
platform_profiles,
Contains("platform:redhatenterpriseworkstation"))
self.assertThat(
platform_profiles,
Contains("platform:rhel"))
self.assertThat(
platform_profiles,
Contains("platform:redhat"))
示例4: main
# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform_profiles [as 别名]
def main(depends=None):
if depends is None:
try:
content = open("other-requirements.txt", "rt").read()
except IOError:
logging.error("No other-requirements.txt file found.")
return 1
depends = Depends(content)
parser = optparse.OptionParser()
parser.add_option("--profiles", action="store_true", help="List the platform and configuration profiles.")
opts, args = parser.parse_args()
if opts.profiles:
logging.info("Platform profiles:")
for profile in depends.platform_profiles():
logging.info("%s", profile)
logging.info("")
logging.info("Configuration profiles:")
for profile in depends.profiles():
logging.info("%s", profile)
else:
if args:
profiles = args
else:
profiles = ["default"]
profiles = profiles + depends.platform_profiles()
rules = depends.active_rules(profiles)
errors = depends.check_rules(rules)
for error in errors:
if error[0] == "missing":
logging.info("Missing packages:")
logging.info(" %s", " ".join(error[1]))
if error[0] == "badversion":
logging.info("Bad versions of installed packages:")
for pkg, constraint, version in error[1]:
logging.info(" %s version %s does not match %s", pkg, version, constraint)
if errors:
return 1
return 0
示例5: test_detects_opensuse_project
# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform_profiles [as 别名]
def test_detects_opensuse_project(self):
# TODO what does an os-release for opensuse project look like?
# Is this different than sles, leap, and tumbleweed?
with DistroFixture("openSUSEleap"):
depends = Depends("")
platform_profiles = depends.platform_profiles()
self.assertThat(platform_profiles,
Contains("platform:opensuseproject"))
self.assertThat(platform_profiles,
Contains("platform:opensuse"))
self.assertThat(platform_profiles,
Contains("platform:opensuseproject-42.1"))
self.assertThat(platform_profiles,
Contains("platform:suse"))
示例6: test_alpine_implies_apk
# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform_profiles [as 别名]
def test_alpine_implies_apk(self):
with DistroFixture("Alpine"):
depends = Depends("")
self.assertThat(
depends.platform_profiles(), Contains("platform:apk"))
self.assertIsInstance(depends.platform, Apk)
示例7: test_suse_linux_implies_rpm
# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform_profiles [as 别名]
def test_suse_linux_implies_rpm(self):
with DistroFixture("SLES"):
depends = Depends("")
self.assertThat(
depends.platform_profiles(), Contains("platform:rpm"))
self.assertIsInstance(depends.platform, Rpm)
示例8: test_ubuntu_implies_dpkg
# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform_profiles [as 别名]
def test_ubuntu_implies_dpkg(self):
with DistroFixture("Ubuntu"):
depends = Depends("")
self.assertThat(
depends.platform_profiles(), Contains("platform:dpkg"))
self.assertIsInstance(depends.platform, Dpkg)
示例9: test_rhel_implies_rpm
# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform_profiles [as 别名]
def test_rhel_implies_rpm(self):
with DistroFixture("RHELServer"):
depends = Depends("")
self.assertThat(
depends.platform_profiles(), Contains("platform:rpm"))
self.assertIsInstance(depends.platform, Rpm)
示例10: test_opensuse_leap15_implies_rpm
# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform_profiles [as 别名]
def test_opensuse_leap15_implies_rpm(self):
with DistroFixture("openSUSEleap15"):
depends = Depends("")
self.assertThat(
depends.platform_profiles(), Contains("platform:rpm"))
self.assertIsInstance(depends.platform, Rpm)
示例11: test_detects_subrelease
# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform_profiles [as 别名]
def test_detects_subrelease(self):
with DistroFixture("Ubuntu"):
depends = Depends("")
self.assertThat(
depends.platform_profiles(), Contains("platform:ubuntu-16.04"))
示例12: test_detects_codename
# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform_profiles [as 别名]
def test_detects_codename(self):
with DistroFixture("Ubuntu"):
depends = Depends("")
self.assertThat(
depends.platform_profiles(),
Contains("platform:ubuntu-xenial"))
示例13: test_detects_suse_linux
# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform_profiles [as 别名]
def test_detects_suse_linux(self):
with DistroFixture("SLES"):
depends = Depends("")
platform_profiles = depends.platform_profiles()
self.assertThat(platform_profiles, Contains("platform:suselinux"))
self.assertThat(platform_profiles, Contains("platform:suse"))
示例14: test_detects_alpine
# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform_profiles [as 别名]
def test_detects_alpine(self):
with DistroFixture("Alpine"):
depends = Depends("")
self.assertThat(
depends.platform_profiles(), Contains("platform:alpine"))
示例15: test_arch_implies_pacman
# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform_profiles [as 别名]
def test_arch_implies_pacman(self):
with DistroFixture("Arch"):
depends = Depends("")
self.assertThat(
depends.platform_profiles(), Contains("platform:pacman"))
self.assertIsInstance(depends.platform, Pacman)