Esempio n. 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")
Esempio n. 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")
Esempio n. 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")
Esempio n. 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")
Esempio n. 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")
Esempio n. 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")
Esempio n. 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")
Esempio n. 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")
Esempio n. 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")
Esempio n. 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")