feat: Add update checker tooling
Add the initial dataset, version checker, tests, and project setup files so the update checker can be run and validated.
This commit is contained in:
parent
1eddaca1ad
commit
95cd8e0906
10 changed files with 692 additions and 20 deletions
27
tests/test_versions.py
Normal file
27
tests/test_versions.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.append(str(Path(__file__).resolve().parents[1]))
|
||||
|
||||
from check_updates import compare_versions
|
||||
|
||||
|
||||
def test_compare_versions_newer():
|
||||
assert compare_versions("1.2.3", "1.2.4") == 1
|
||||
|
||||
|
||||
def test_compare_versions_equal():
|
||||
assert compare_versions("2.0.0", "2.0.0") == 0
|
||||
|
||||
|
||||
def test_compare_versions_older():
|
||||
assert compare_versions("2.1.0", "2.0.9") == -1
|
||||
|
||||
|
||||
def test_compare_versions_unparseable():
|
||||
assert compare_versions("1.2", "1.2.3") is None
|
||||
|
||||
|
||||
def test_compare_versions_prerelease():
|
||||
assert compare_versions("1.2.3-alpha.1", "1.2.3") == 1
|
||||
assert compare_versions("1.2.3", "1.2.3-alpha.1") == -1
|
||||
Loading…
Add table
Add a link
Reference in a new issue