示例#1
0
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
示例#2
0
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
示例#3
0
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
示例#4
0
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
示例#5
0
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
示例#6
0
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