本文整理汇总了Python中conda.models.match_spec.MatchSpec.get_exact_value方法的典型用法代码示例。如果您正苦于以下问题:Python MatchSpec.get_exact_value方法的具体用法?Python MatchSpec.get_exact_value怎么用?Python MatchSpec.get_exact_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类conda.models.match_spec.MatchSpec
的用法示例。
在下文中一共展示了MatchSpec.get_exact_value方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_track_features_match
# 需要导入模块: from conda.models.match_spec import MatchSpec [as 别名]
# 或者: from conda.models.match_spec.MatchSpec import get_exact_value [as 别名]
def test_track_features_match(self):
dst = Dist('defaults::foo-1.2.3-4.tar.bz2')
a = MatchSpec(features='test')
assert text_type(a) == "*[features=test]"
assert not a.match(DPkg(dst))
assert not a.match(DPkg(dst, track_features=''))
a = MatchSpec(track_features='test')
assert a.match(DPkg(dst, track_features='test'))
assert not a.match(DPkg(dst, track_features='test2'))
assert not a.match(DPkg(dst, track_features='test me'))
assert not a.match(DPkg(dst, track_features='you test'))
assert not a.match(DPkg(dst, track_features='you test me'))
assert a.get_exact_value('track_features') == frozenset(('test',))
b = MatchSpec(track_features='mkl')
assert not b.match(DPkg(dst))
assert b.match(DPkg(dst, track_features='mkl'))
assert b.match(DPkg(dst, track_features='mkl'))
assert not b.match(DPkg(dst, track_features='mkl debug'))
assert not b.match(DPkg(dst, track_features='debug'))
c = MatchSpec(track_features='nomkl')
assert not c.match(DPkg(dst))
assert not c.match(DPkg(dst, track_features='mkl'))
assert c.match(DPkg(dst, track_features='nomkl'))
assert not c.match(DPkg(dst, track_features='nomkl debug'))
# regression test for #6860
d = MatchSpec(track_features='')
assert d.get_exact_value('track_features') == frozenset()
d = MatchSpec(track_features=' ')
assert d.get_exact_value('track_features') == frozenset()
d = MatchSpec(track_features=('', ''))
assert d.get_exact_value('track_features') == frozenset()
d = MatchSpec(track_features=('', '', 'test'))
assert d.get_exact_value('track_features') == frozenset(('test',))
示例2: test_build_number_and_filename
# 需要导入模块: from conda.models.match_spec import MatchSpec [as 别名]
# 或者: from conda.models.match_spec.MatchSpec import get_exact_value [as 别名]
def test_build_number_and_filename(self):
ms = MatchSpec('zlib 1.2.7 0')
assert ms.get_exact_value('name') == 'zlib'
assert ms.get_exact_value('version') == '1.2.7'
assert ms.get_exact_value('build') == '0'
assert ms._to_filename_do_not_use() == 'zlib-1.2.7-0.tar.bz2'