本文整理汇总了Python中twitter.common.python.platforms.Platform.compatible方法的典型用法代码示例。如果您正苦于以下问题:Python Platform.compatible方法的具体用法?Python Platform.compatible怎么用?Python Platform.compatible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twitter.common.python.platforms.Platform
的用法示例。
在下文中一共展示了Platform.compatible方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_unknown
# 需要导入模块: from twitter.common.python.platforms import Platform [as 别名]
# 或者: from twitter.common.python.platforms.Platform import compatible [as 别名]
def test_unknown(self):
with pytest.raises(Platform.UnknownPlatformError):
Platform.compatible('macosx-10.0-morfgorf', 'macosx-10.1-morfgorf')
with pytest.raises(Platform.UnknownPlatformError):
Platform.compatible('macosx-10.0-x86_64', 'macosx-10.1-morfgorf')
with pytest.raises(Platform.UnknownPlatformError):
Platform.compatible('macosx-10.0-morfgorf', 'macosx-10.1-x86_64')
示例2: test_versioning
# 需要导入模块: from twitter.common.python.platforms import Platform [as 别名]
# 或者: from twitter.common.python.platforms.Platform import compatible [as 别名]
def test_versioning(self):
# Major versions incompatible
assert not Platform.compatible('macosx-9.1-x86_64', 'macosx-10.0-x86_64')
assert not Platform.compatible('macosx-10.0-x86_64', 'macosx-9.1-x86_64')
# Platforms equal
assert Platform.compatible('macosx-10.0-x86_64', 'macosx-10.0-x86_64')
# Minor versions less than
assert Platform.compatible('macosx-10.0-x86_64', 'macosx-10.1-x86_64')
assert not Platform.compatible('macosx-10.1-x86_64', 'macosx-10.0-x86_64')
assert Platform.compatible('macosx-10.9-x86_64', 'macosx-10.10-x86_64')
assert not Platform.compatible('macosx-10.10-x86_64', 'macosx-10.9-x86_64')
示例3: test_platform_subsets
# 需要导入模块: from twitter.common.python.platforms import Platform [as 别名]
# 或者: from twitter.common.python.platforms.Platform import compatible [as 别名]
def test_platform_subsets(self):
# Pure platform subset
assert Platform.compatible('macosx-10.0-i386', 'macosx-10.0-intel')
# Version and platform subset
assert Platform.compatible('macosx-10.0-i386', 'macosx-10.1-intel')
assert Platform.compatible('macosx-10.0-x86_64', 'macosx-10.1-intel')
# Intersecting sets of platform but not pure subset
assert Platform.compatible('macosx-10.0-fat', 'macosx-10.1-intel')
# Non-intersecting sets of platform
assert not Platform.compatible('macosx-10.0-ppc', 'macosx-10.1-intel')
# Test our common case
assert Platform.compatible('macosx-10.4-x86_64', 'macosx-10.7-intel')
示例4: test_cross_platform
# 需要导入模块: from twitter.common.python.platforms import Platform [as 别名]
# 或者: from twitter.common.python.platforms.Platform import compatible [as 别名]
def test_cross_platform(self):
assert not Platform.compatible('linux-x86_64', 'macosx-10.0-x86_64')
# TODO(wickman): Should we do extended platform support beyond OS X?
assert not Platform.compatible('linux-i386', 'linux-x86_64')
示例5: test_pure_python
# 需要导入模块: from twitter.common.python.platforms import Platform [as 别名]
# 或者: from twitter.common.python.platforms.Platform import compatible [as 别名]
def test_pure_python(self):
assert Platform.compatible(None, None)
assert Platform.compatible(None, 'i386')
assert Platform.compatible(None, 'universal')
示例6: platform_compatible
# 需要导入模块: from twitter.common.python.platforms import Platform [as 别名]
# 或者: from twitter.common.python.platforms.Platform import compatible [as 别名]
def platform_compatible():
return Platform.compatible(dist.platform, self.platform)