Skip to content

Commit

Permalink
Integrate review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicoretti committed Mar 13, 2024
1 parent 52474f7 commit 43ac47c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions exasol/toolbox/release/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ def __eq__(self, other):
@staticmethod
def from_string(version):
parts = [int(number, base=0) for number in version.split(".")]
if len(parts) > 3:
raise ValueError(
"Version has an invalid format, "
f"expected: '<major>.<minor>.<patch>', actual: '{version}'"
)
version = [_index_or(parts, i, 0) for i in range(3)]
return Version(*version)

Expand Down
1 change: 1 addition & 0 deletions test/unit/cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@pytest.mark.parametrize(
"version_string,expected_error",
[
("4.4.4.4", ArgumentTypeError),
("1.b.a", ArgumentTypeError),
("F.b.a", ArgumentTypeError),
("F", ArgumentTypeError),
Expand Down
6 changes: 3 additions & 3 deletions test/unit/git_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ def git_tag():
stdout=cleandoc(
"""
0.0.1
0.6.2
0.1.0
0.2.0
0.5.0
0.3.0
0.4.0
0.5.0
0.6.0
0.6.1
0.6.2
0.7.0
0.8.0
0.7.0
"""
).encode("utf8"),
stderr="",
Expand Down

0 comments on commit 43ac47c

Please sign in to comment.