Exemplo n.º 1
0
def test_specmask():
    s = SpecMask('1.0.0')
    assert (Spec('1.0.0') == s.specs[0].spec)
Exemplo n.º 2
0
def test_specmask_one_or():
    s = SpecMask('1.0.0 || 2.0.0')
    assert (Spec('1.0.0') == s.specs[0].spec)
    assert (Spec('2.0.0') == s.specs[1].spec)
Exemplo n.º 3
0
def test_specmask_contains():
    mask = '1.0.0'
    s = SpecMask(mask)
    assert ('1.0.0' in s)
    assert ('1.0.1' not in s)
Exemplo n.º 4
0
def test_specmask_match():
    mask = '1.0.0'
    s = SpecMask(mask)
    assert (s.match('1.0.0') is True)
    assert (s.match('1.0.1') is False)
Exemplo n.º 5
0
def test_mixed_boolean_will_assert():
    with pytest.raises(ValueError):
        SpecMask('1.0.0 && 2.0.0 || 3.0.0')
Exemplo n.º 6
0
def test_specmask_multi_ands():
    s = SpecMask('1.0.0 && 2.0.0 && 3.0.0 && 4.0.0')
    assert (Spec('1.0.0') == s.specs[0].spec)
    assert (Spec('2.0.0') == s.specs[1].spec)
    assert (Spec('3.0.0') == s.specs[2].spec)
    assert (Spec('4.0.0') == s.specs[3].spec)
Exemplo n.º 7
0
def test_specmask_multi_ors():
    s = SpecMask('1.0.0 || 2.0.0 || 3.0.0 || 4.0.0')
    assert (Spec('1.0.0') == s.specs[0].spec)
    assert (Spec('2.0.0') == s.specs[1].spec)
    assert (Spec('3.0.0') == s.specs[2].spec)
    assert (Spec('4.0.0') == s.specs[3].spec)