terraformDummyRepo/test/test_version.py

25 lines
No EOL
761 B
Python

from devops_test import Version, ReleaseLevel
def test_version():
version = Version([1, 2, 3], False)
version.increment(ReleaseLevel.SNAPSHOT)
assert version.get() == "1.2.3-SNAPSHOT"
assert version.version == [1, 2, 3]
assert version.is_snapshot
version.increment(ReleaseLevel.PATCH)
assert version.get() == "1.2.4"
assert version.version == [1, 2, 4]
assert not version.is_snapshot
version.increment(ReleaseLevel.SNAPSHOT)
assert version.get() == "1.2.4-SNAPSHOT"
version.increment(ReleaseLevel.SNAPSHOT)
assert version.get() == "1.2.4-SNAPSHOT"
version.increment(ReleaseLevel.MINOR)
assert version.get() == "1.3.0"
version.increment(ReleaseLevel.MAJOR)
assert version.get() == "2.0.0"