def test_specitemmask_asterisk_forms():
    s = SpecItemMask(' *')
    assert s.kind == '*'

    s = SpecItemMask(' *  ')
    assert s.kind == '*'

    s = SpecItemMask('*')
    assert s.kind == '*'

    with pytest.raises(ValueError):
        SpecItemMask('bad*')

    with pytest.raises(ValueError):
        SpecItemMask('* bad')
def test_specitemmask_asterisk():
    s = SpecItemMask('*')
    assert (Spec('*') == s.spec)
    assert (Version('0.0.1') in s.spec)
    assert (Version('0.1.1-alpha') in s.spec)
def test_coerceable_version():
    s = SpecItemMask('1')
    assert (Spec('1') == s.spec)
def test_specitemmask_modifiers_2():
    s = SpecItemMask('~>1.0.0')
    assert (Spec('~>1.0.0') == s.spec)
def test_specitemmask_yes3():
    s = SpecItemMask('L.L.Y', current_version=Version('1.8.3'))
    assert (Spec('*') == s.spec)
def test_next_best_specitemmask():
    s = SpecItemMask('-1.0.0')
    assert (Spec('1.0.0') == s.spec)
    assert s.has_next_best
def test_specitemmask_lock6():
    with pytest.raises(ValueError):
        SpecItemMask('L-1.L999.L', current_version=Version('1.8.3'))
def test_specitemmask_lock5():
    s = SpecItemMask('L1.L999.L', current_version=Version('1.8.3'))
    assert (Spec('2.1007.3') == s.spec)
def test_specitemmask_lock2():
    s = SpecItemMask('L.L.0', current_version=Version('1.8.0'))
    assert (Spec('1.8.0') == s.spec)
def test_partial_versions_3():
    mask = 'L'
    current_version = '1'
    s = SpecItemMask(mask, current_version)
    assert (s.spec == Spec('==1'))
def test_partial_versions_2():
    mask = '1'
    s = SpecItemMask(mask)
    assert (s.spec == Spec('1'))