mirror of
https://github.com/Donkie/Spoolman.git
synced 2026-10-19 00:29:46 -05:00
The server checks the latest GitHub release in the background at startup and every 12h, logs a warning when a newer version exists, and exposes latest_version/update_available on /info. The client_v2 footer shows a link to the new release. Disable with SPOOLMAN_UPDATE_CHECK=FALSE.
15 lines
521 B
Python
15 lines
521 B
Python
"""Tests for the release version comparison used by the update check."""
|
|
|
|
from spoolman.update_check import is_newer
|
|
|
|
|
|
def test_is_newer() -> None:
|
|
assert is_newer("0.28.0", "0.27.0")
|
|
assert is_newer("v0.27.1", "0.27.0")
|
|
assert is_newer("1.0.0", "0.99.9")
|
|
assert is_newer("0.10.0", "0.9.0") # numeric, not string, compare
|
|
assert not is_newer("0.27.0", "0.27.0")
|
|
assert not is_newer("0.26.5", "0.27.0")
|
|
assert not is_newer("0.28.0", "unknown")
|
|
assert not is_newer("0.28.0-beta", "0.27.0")
|