示例#1
0
 def test_features(self):
     dst = Dist('defaults::foo-1.2.3-4.tar.bz2')
     a = MatchSpec(features='test')
     assert a.match(DPkg(dst, features='test'))
     assert not a.match(DPkg(dst, features='test2'))
     assert a.match(DPkg(dst, features='test me'))
     assert a.match(DPkg(dst, features='you test'))
     assert a.match(DPkg(dst, features='you test me'))
     assert a.exact_field('features') == 'test'
示例#2
0
 def test_build_number_and_filename(self):
     ms = MatchSpec('zlib 1.2.7 0')
     assert ms.exact_field('name') == 'zlib'
     assert ms.exact_field('version') == '1.2.7'
     assert ms.exact_field('build') == '0'
     assert ms.to_filename() == 'zlib-1.2.7-0.tar.bz2'