tests: 300 comes back as "300" from a platform whose key is not an integer
CI & Build / Build now, or wait for Android? (push) Successful in 3s
Android / Build, or is the channel already serving this? (push) Successful in 3s
Android / Kotlin + Rust (APK) (push) Skipped
CI & Build / Python lint (push) Successful in 4s
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
Desktop (Tauri) / Tauri desktop (Linux) (push) Skipped
Desktop (Tauri) / Windows installer (cross-compiled) (push) Skipped
Desktop (Tauri) / Update manifest (push) Skipped
CI & Build / TypeScript typecheck (push) Successful in 7s
CI & Build / Python tests (push) Successful in 11s
CI & Build / integration (push) Successful in 15s
CI & Build / Build & push image (push) Successful in 41s

The precedence test wrote `version_code=300` for all five platforms and compared
the desktop's against the int it wrote. It comes back as `"300"`, because the
module preserves each platform's own comparator type instead of flattening both
to int — which is the behaviour the change it was testing had just introduced.

A `coded()` helper now says which shape to expect and why, and the assertion runs
over every non-Android platform rather than spot-checking `linux-deb`. The test
caught a real inconsistency in itself precisely because it compared against a
concrete value rather than round-tripping what it wrote.
This commit is contained in:
Bryan Van Deusen
2026-08-30 13:19:18 -04:00
parent ff6e99eb62
commit d2f9d316cf
+13 -1
View File
@@ -47,6 +47,16 @@ def code_for(platform_id: str):
return ANDROID_CODE if BY_ID[platform_id].code_is_int else DESKTOP_CODE
def coded(platform_id: str, value: int):
"""`value` in the shape that platform's sidecar carries.
A test writing `version_code=300` gets `300` back from Android and `"300"` from
a desktop platform, because the module preserves each platform's own comparator
type rather than flattening both to int.
"""
return value if BY_ID[platform_id].code_is_int else str(value)
@pytest.fixture(autouse=True)
def _empty_baked_client(tmp_path, monkeypatch):
"""Point the baked-in copy at an empty directory.
@@ -306,7 +316,9 @@ def test_precedence_is_decided_per_platform_not_for_the_whole_set():
place("android", version_code=99)
found = releases()
assert found["android"]["version_code"] == 99
assert found["linux-deb"]["version_code"] == 300
for platform_id in ALL_IDS:
if platform_id != "android":
assert found[platform_id]["version_code"] == coded(platform_id, 300), platform_id
assert set(found) == set(ALL_IDS)