本文整理匯總了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'