diff --git a/tests/test_client_dist.py b/tests/test_client_dist.py index 7a257e9..812e04a 100644 --- a/tests/test_client_dist.py +++ b/tests/test_client_dist.py @@ -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)