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


Python Depends.platform方法代码示例

本文整理汇总了Python中bindep.depends.Depends.platform方法的典型用法代码示例。如果您正苦于以下问题:Python Depends.platform方法的具体用法?Python Depends.platform怎么用?Python Depends.platform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bindep.depends.Depends的用法示例。


在下文中一共展示了Depends.platform方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_check_rule_present

# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform [as 别名]
 def test_check_rule_present(self):
     depends = Depends("")
     depends.platform = mock.MagicMock()
     mock_depend_platform = self.useFixture(
         fixtures.MockPatchObject(depends.platform, 'get_pkg_version',
                                  return_value="123")).mock
     self.assertEqual([], depends.check_rules([("foo", [], [])]))
     mock_depend_platform.assert_called_once_with("foo")
开发者ID:openstack-infra,项目名称:bindep,代码行数:10,代码来源:test_depends.py

示例2: test_check_rule_present

# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform [as 别名]
 def test_check_rule_present(self):
     depends = Depends("")
     mocker = mox.Mox()
     depends.platform = mocker.CreateMock(Platform)
     depends.platform.get_pkg_version("foo").AndReturn("123")
     mocker.ReplayAll()
     self.addCleanup(mocker.VerifyAll)
     self.assertEqual([], depends.check_rules([("foo", [], [])]))
开发者ID:dtroyer,项目名称:bindep,代码行数:10,代码来源:test_depends.py

示例3: test_check_rule_missing_version

# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform [as 别名]
 def test_check_rule_missing_version(self):
     depends = Depends("")
     depends.platform = mock.MagicMock()
     mock_depend_platform = self.useFixture(
         fixtures.MockPatchObject(depends.platform, 'get_pkg_version',
                                  return_value=None)).mock
     self.assertEqual(
         [('missing', ['foo'])],
         depends.check_rules([("foo", [], [(">=", "1.2.3")])]))
     mock_depend_platform.assert_called_once_with("foo")
开发者ID:openstack-infra,项目名称:bindep,代码行数:12,代码来源:test_depends.py

示例4: test_check_rule_incompatible

# 需要导入模块: from bindep.depends import Depends [as 别名]
# 或者: from bindep.depends.Depends import platform [as 别名]
 def test_check_rule_incompatible(self):
     depends = Depends("")
     mocker = mox.Mox()
     depends.platform = mocker.CreateMock(Platform)
     depends.platform.get_pkg_version("foo").AndReturn("123")
     mocker.ReplayAll()
     self.addCleanup(mocker.VerifyAll)
     self.assertEqual(
         [('badversion', [('foo', "!=123", "123")])],
         depends.check_rules([("foo", [], [("!=", "123")])]))
开发者ID:dtroyer,项目名称:bindep,代码行数:12,代码来源:test_depends.py


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