adjust version to bump only patch level
This commit is contained in:
parent
634c8ff725
commit
ce69b5970d
2 changed files with 3 additions and 6 deletions
|
@ -56,8 +56,7 @@ class Version(Validateable):
|
||||||
if self.is_snapshot():
|
if self.is_snapshot():
|
||||||
return Version(new_version_list, snapshot_suffix=self.snapshot_suffix, version_str=None)
|
return Version(new_version_list, snapshot_suffix=self.snapshot_suffix, version_str=None)
|
||||||
else:
|
else:
|
||||||
new_version_list[2] = 0
|
new_version_list[2] += 1
|
||||||
new_version_list[1] += 1
|
|
||||||
return Version(new_version_list, snapshot_suffix=snapshot_suffix, version_str=None)
|
return Version(new_version_list, snapshot_suffix=snapshot_suffix, version_str=None)
|
||||||
|
|
||||||
def create_patch(self):
|
def create_patch(self):
|
||||||
|
|
|
@ -99,16 +99,14 @@ def test_should_create_major():
|
||||||
assert sut.to_string() == "2.0.0"
|
assert sut.to_string() == "2.0.0"
|
||||||
|
|
||||||
def test_should_create_bump():
|
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")
|
version = Version.from_str("1.2.3-SNAPSHOT")
|
||||||
sut = version.create_bump()
|
sut = version.create_bump()
|
||||||
assert sut.to_string() == "1.2.3-SNAPSHOT"
|
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")
|
version = Version.from_str("1.2.3")
|
||||||
sut = version.create_bump("SNAPSHOT")
|
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")
|
version = Version.from_str("1.0.0")
|
||||||
sut = version.create_bump("SNAPSHOT")
|
sut = version.create_bump("SNAPSHOT")
|
||||||
assert sut.to_string() == "1.1.0-SNAPSHOT"
|
assert sut.to_string() == "1.0.1-SNAPSHOT"
|
Loading…
Reference in a new issue