Exemplo n.º 1
0
def test_bump_by_value_error():
    v = Version(release=1)

    with pytest.raises(ValueError, match='negative'):
        v.bump_epoch(by=-1)

    with pytest.raises(ValueError, match='negative'):
        v.bump_dev(by=-1)

    with pytest.raises(ValueError, match='negative'):
        v.bump_pre(by=-1)

    with pytest.raises(ValueError, match='negative'):
        v.bump_post(by=-1)
Exemplo n.º 2
0
def test_bump_by_error(by):
    v = Version(release=1)

    with pytest.raises(TypeError):
        v.bump_epoch(by=by)

    with pytest.raises(TypeError):
        v.bump_dev(by=by)

    with pytest.raises(TypeError):
        v.bump_pre('a', by=by)

    with pytest.raises(TypeError):
        v.bump_post(by=by)