def test_to_filename(self): m1 = MatchSpec(fn='foo-1.7-52.tar.bz2') m2 = MatchSpec(name='foo', version='1.7', build='52') m3 = MatchSpec(Dist('defaults::foo-1.7-52')) assert m1._to_filename_do_not_use() == 'foo-1.7-52.tar.bz2' assert m2._to_filename_do_not_use() == 'foo-1.7-52.tar.bz2' assert m3._to_filename_do_not_use() == 'foo-1.7-52.tar.bz2' for spec in 'bitarray', 'pycosat 0.6.0', 'numpy 1.6*': ms = MatchSpec(spec) assert ms._to_filename_do_not_use() is None
def test_to_filename(self): m1 = MatchSpec(fn='foo-1.7-52.tar.bz2') m2 = MatchSpec(name='foo', version='1.7', build='52') m3 = MatchSpec(Dist('defaults::foo-1.7-52')) assert m1._to_filename_do_not_use() == 'foo-1.7-52.tar.bz2' assert m2._to_filename_do_not_use() == 'foo-1.7-52.tar.bz2' assert m3._to_filename_do_not_use() == 'foo-1.7-52.tar.bz2' for spec in 'bitarray', 'pycosat 0.6.0', 'numpy 1.6*': ms = MatchSpec(spec) assert ms._to_filename_do_not_use() is None
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'
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'