def test_spec_tuple_select(): spec = AsdfSpec('>=1.1.0') versions = [(1,0,0), (1,0,9), (1,1,0), (1,2,0)] assert spec.select(versions) == '1.2.0' assert spec.select(versions[:-1]) == '1.1.0' assert spec.select(versions[:-2]) == None
def test_spec_string_select(): spec = AsdfSpec('>=1.1.0') versions = ['1.0.0', '1.0.9', '1.1.0', '1.2.0'] assert spec.select(versions) == '1.2.0' assert spec.select(versions[:-1]) == '1.1.0' assert spec.select(versions[:-2]) == None
def test_spec_version_select(): spec = AsdfSpec('>=1.1.0') versions = [AsdfVersion(x) for x in ['1.0.0', '1.0.9', '1.1.0', '1.2.0']] assert spec.select(versions) == '1.2.0' assert spec.select(versions[:-1]) == '1.1.0' assert spec.select(versions[:-2]) == None