refactor(version): simplify version comparison logic (#10109)

This commit is contained in:
-LAN-
2024-10-31 15:15:32 +08:00
committed by GitHub
parent 66e9bd90eb
commit 8b9fed75f3
2 changed files with 8 additions and 49 deletions

View File

@@ -22,17 +22,3 @@ from controllers.console.version import _has_new_version
)
def test_has_new_version(latest_version, current_version, expected):
assert _has_new_version(latest_version=latest_version, current_version=current_version) == expected
def test_has_new_version_invalid_input():
with pytest.raises(ValueError):
_has_new_version(latest_version="1.0", current_version="1.0.0")
with pytest.raises(ValueError):
_has_new_version(latest_version="1.0.0", current_version="1.0")
with pytest.raises(ValueError):
_has_new_version(latest_version="invalid", current_version="1.0.0")
with pytest.raises(ValueError):
_has_new_version(latest_version="1.0.0", current_version="invalid")