Beispiel #1
0
def test_from_string(string: str, numbers: Tuple):
    if not numbers:
        with pytest.raises(ValueError):
            _ = Version.from_string(string)
    else:
        version = Version.from_string(string)
        assert version.tuple == numbers
        assert Version(*numbers) == version
Beispiel #2
0
def test_tag(string: str):
    assert Version.from_string(string).tag == 'v' + string
Beispiel #3
0
def test_string_round_trip(string: str):
    assert str(Version.from_string(string)) == string