Beispiel #1
0
def test_parse_version():
    """Try parsing a variety of different version strings"""
    assert util.parse_version("1.0.0") == (1, 0, 0, None, None)
    assert util.parse_version("1.0.0-alpha") == (1, 0, 0, "alpha", None)
    assert util.parse_version("1.0.0-alpha.1") == (1, 0, 0, "alpha.1", None)
    assert util.parse_version("1.0.0-0.3.7") == (1, 0, 0, "0.3.7", None)
    assert util.parse_version("1.0.0-x.7.z.92") == (1, 0, 0, "x.7.z.92", None)
    assert util.parse_version("1.0.0-alpha+001") == (1, 0, 0, "alpha", "001")
    assert util.parse_version("1.0.0+20130313144700") == (1, 0, 0, None, "20130313144700")
    assert util.parse_version("1.0.0-beta+exp.sha.5114f85") == (1, 0, 0, "beta", "exp.sha.5114f85")
Beispiel #2
0
def test_parse_version():
    """Try parsing a variety of different version strings"""
    assert util.parse_version("1.0.0") == (1, 0, 0, None, None)
    assert util.parse_version("1.0.0-alpha") == (1, 0, 0, "alpha", None)
    assert util.parse_version("1.0.0-alpha.1") == (1, 0, 0, "alpha.1", None)
    assert util.parse_version("1.0.0-0.3.7") == (1, 0, 0, "0.3.7", None)
    assert util.parse_version("1.0.0-x.7.z.92") == (1, 0, 0, "x.7.z.92", None)
    assert util.parse_version("1.0.0-alpha+001") == (1, 0, 0, "alpha", "001")
    assert util.parse_version("1.0.0+20130313144700") == (1, 0, 0, None,
                                                          "20130313144700")
    assert util.parse_version("1.0.0-beta+exp.sha.5114f85") == (
        1, 0, 0, "beta", "exp.sha.5114f85")
Beispiel #3
0
def test_parse_version_invalid_metadata():
    """Check that an error is raised when the metadata is invalid"""
    util.parse_version("1.0.0-alpha+foo~bar")
Beispiel #4
0
def test_parse_version_invalid_prerelease():
    """Check that an error is raised when the prerelease version is invalid"""
    util.parse_version("1.0.0-alpha~1")
Beispiel #5
0
def test_parse_version_invalid_patch():
    """Check that an error is raised when the patch version is invalid"""
    util.parse_version("1.0.0~alpha")
Beispiel #6
0
def test_parse_version_invalid_minor():
    """Check that an error is raised when the minor version is invalid"""
    util.parse_version("1.0-alpha.0")
Beispiel #7
0
def test_parse_version_invalid_metadata():
    """Check that an error is raised when the metadata is invalid"""
    util.parse_version("1.0.0-alpha+foo~bar")
Beispiel #8
0
def test_parse_version_invalid_prerelease():
    """Check that an error is raised when the prerelease version is invalid"""
    util.parse_version("1.0.0-alpha~1")
Beispiel #9
0
def test_parse_version_invalid_patch():
    """Check that an error is raised when the patch version is invalid"""
    util.parse_version("1.0.0~alpha")
Beispiel #10
0
def test_parse_version_invalid_minor():
    """Check that an error is raised when the minor version is invalid"""
    util.parse_version("1.0-alpha.0")