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


Python Depends.platform_profiles方法代码示例

本文整理汇总了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"))
开发者ID:openstack-infra,项目名称:bindep,代码行数:10,代码来源:test_depends.py

示例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')
开发者ID:openstack-infra,项目名称:bindep,代码行数:11,代码来源:test_depends.py

示例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"))
开发者ID:openstack-infra,项目名称:bindep,代码行数:15,代码来源:test_depends.py

示例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
开发者ID:pombredanne,项目名称:bindep,代码行数:40,代码来源:main.py

示例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"))
开发者ID:openstack-infra,项目名称:bindep,代码行数:16,代码来源:test_depends.py

示例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)
开发者ID:openstack-infra,项目名称:bindep,代码行数:8,代码来源:test_depends.py

示例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)
开发者ID:openstack-infra,项目名称:bindep,代码行数:8,代码来源:test_depends.py

示例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)
开发者ID:openstack-infra,项目名称:bindep,代码行数:8,代码来源:test_depends.py

示例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)
开发者ID:openstack-infra,项目名称:bindep,代码行数:8,代码来源:test_depends.py

示例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)
开发者ID:openstack-infra,项目名称:bindep,代码行数:8,代码来源:test_depends.py

示例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"))
开发者ID:openstack-infra,项目名称:bindep,代码行数:7,代码来源:test_depends.py

示例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"))
开发者ID:openstack-infra,项目名称:bindep,代码行数:8,代码来源:test_depends.py

示例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"))
开发者ID:openstack-infra,项目名称:bindep,代码行数:8,代码来源:test_depends.py

示例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"))
开发者ID:openstack-infra,项目名称:bindep,代码行数:7,代码来源:test_depends.py

示例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)
开发者ID:openstack-infra,项目名称:bindep,代码行数:8,代码来源:test_depends.py


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