Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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")
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")
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")
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")
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")
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")
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")
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")
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")