adjust version to bump only patch level

merge-requests/12/head
Michael Jerger 1 year ago
parent 634c8ff725
commit ce69b5970d

@ -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):

@ -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"
Loading…
Cancel
Save