mirror of
https://github.com/Mic92/nix-update.git
synced 2024-11-03 21:04:49 +03:00
improve version assertions in tests
fixes broken tests due to flaky string comparisons
This commit is contained in:
parent
430c441072
commit
2fdb989360
@ -21,7 +21,7 @@ def test_main(helpers: conftest.Helpers) -> None:
|
|||||||
text=True,
|
text=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
).stdout.strip()
|
).stdout.strip()
|
||||||
assert version >= "8.5.2"
|
assert tuple(map(int, version.split("."))) >= (8, 5, 2)
|
||||||
commit = subprocess.run(
|
commit = subprocess.run(
|
||||||
["git", "-C", path, "log", "-1"],
|
["git", "-C", path, "log", "-1"],
|
||||||
text=True,
|
text=True,
|
||||||
|
@ -23,7 +23,7 @@ def test_main(helpers: conftest.Helpers) -> None:
|
|||||||
text=True,
|
text=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
).stdout.strip()
|
).stdout.strip()
|
||||||
assert version >= "30"
|
assert int(version) >= 30
|
||||||
commit = subprocess.run(
|
commit = subprocess.run(
|
||||||
["git", "-C", path, "log", "-1"],
|
["git", "-C", path, "log", "-1"],
|
||||||
text=True,
|
text=True,
|
||||||
|
@ -23,7 +23,7 @@ def test_main(helpers: conftest.Helpers) -> None:
|
|||||||
text=True,
|
text=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
).stdout.strip()
|
).stdout.strip()
|
||||||
assert version >= "8.5.2"
|
assert tuple(map(int, version.split("."))) >= (8, 5, 2)
|
||||||
commit = subprocess.run(
|
commit = subprocess.run(
|
||||||
["git", "-C", path, "log", "-1"],
|
["git", "-C", path, "log", "-1"],
|
||||||
text=True,
|
text=True,
|
||||||
|
@ -23,7 +23,7 @@ def test_main(helpers: conftest.Helpers) -> None:
|
|||||||
text=True,
|
text=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
).stdout.strip()
|
).stdout.strip()
|
||||||
assert version >= "0.22.0"
|
assert tuple(map(int, version.split("."))) >= (0, 22, 0)
|
||||||
commit = subprocess.run(
|
commit = subprocess.run(
|
||||||
["git", "-C", path, "log", "-1"],
|
["git", "-C", path, "log", "-1"],
|
||||||
text=True,
|
text=True,
|
||||||
|
@ -23,5 +23,5 @@ def test_update(helpers: conftest.Helpers) -> None:
|
|||||||
],
|
],
|
||||||
text=True,
|
text=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
)
|
).stdout.strip()
|
||||||
assert version.stdout.strip() > "10.8.6"
|
assert tuple(map(int, version.split("."))) > (10, 8, 6)
|
||||||
|
@ -23,7 +23,7 @@ def test_main(helpers: conftest.Helpers) -> None:
|
|||||||
text=True,
|
text=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
).stdout.strip()
|
).stdout.strip()
|
||||||
assert version >= "3.0.1"
|
assert tuple(map(int, version.split("."))) >= (3, 0, 1)
|
||||||
commit = subprocess.run(
|
commit = subprocess.run(
|
||||||
["git", "-C", path, "log", "-1"],
|
["git", "-C", path, "log", "-1"],
|
||||||
text=True,
|
text=True,
|
||||||
|
@ -23,5 +23,5 @@ def test_update(helpers: conftest.Helpers) -> None:
|
|||||||
],
|
],
|
||||||
text=True,
|
text=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
)
|
).stdout.strip()
|
||||||
assert version.stdout.strip() >= "0.6.8"
|
assert tuple(map(int, version.split("."))) >= (0, 6, 8)
|
||||||
|
@ -23,5 +23,5 @@ def test_update(helpers: conftest.Helpers) -> None:
|
|||||||
],
|
],
|
||||||
text=True,
|
text=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
)
|
).stdout.strip()
|
||||||
assert version.stdout.strip() >= "0.3.6"
|
assert tuple(map(int, version.split("."))) >= (0, 3, 6)
|
||||||
|
Loading…
Reference in New Issue
Block a user