adjust version to bump only patch level

This commit is contained in:
Michael Jerger 2023-05-12 14:32:31 +02:00
parent 634c8ff725
commit ce69b5970d
2 changed files with 3 additions and 6 deletions

View file

@ -56,8 +56,7 @@ class Version(Validateable):
if self.is_snapshot():
return Version(new_version_list, snapshot_suffix=self.snapshot_suffix, version_str=None)
else:
new_version_list[2] = 0
new_version_list[1] += 1
new_version_list[2] += 1
return Version(new_version_list, snapshot_suffix=snapshot_suffix, version_str=None)
def create_patch(self):

View file

@ -99,16 +99,14 @@ def test_should_create_major():
assert sut.to_string() == "2.0.0"
def test_should_create_bump():
# TODO: bom - 2023_05_11: Why does this not actually bump the version?
version = Version.from_str("1.2.3-SNAPSHOT")
sut = version.create_bump()
assert sut.to_string() == "1.2.3-SNAPSHOT"
# TODO: bom - 2023_05_11: Why do we bump the minor version and not the patch?
version = Version.from_str("1.2.3")
sut = version.create_bump("SNAPSHOT")
assert sut.to_string() == "1.3.0-SNAPSHOT"
assert sut.to_string() == "1.2.4-SNAPSHOT"
version = Version.from_str("1.0.0")
sut = version.create_bump("SNAPSHOT")
assert sut.to_string() == "1.1.0-SNAPSHOT"
assert sut.to_string() == "1.0.1-SNAPSHOT"