def test_parse(): semver = Semver() semver.parse('5.0.0-alpha.2.2') assert semver.major == 5 assert semver.minor == 0 assert semver.patch == 0 assert semver.prefix == '-' assert semver.tag == 'alpha' assert semver.number == 2 assert semver.revision == '2'
def test_next_build(): semver = Semver(tag='build', number=1, revision='a2345') next = semver.next() assert str(next) == '0.0.0+build.2'
def test_next_beta(): semver = Semver(tag='beta', number=1) next = semver.next() assert str(next) == '0.0.0-beta.2'
def test_next(): semver = Semver() next = semver.next() assert str(next) == '0.0.1'
def test_bad(): semver = Semver() semver.parse('5.0-alpha.2.2')