Skip to content

Commit fb7f302

Browse files
committed
test: cover targeted parallel Nuvio drift checker contract
1 parent 5b455ff commit fb7f302

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

tests/nuvio_client_upstream_drift_guard_test.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def run_case(head: str, comparison: dict | None, state: dict | None = None) -> d
5959
old_compare = module.compare
6060
try:
6161
module.current_head = lambda repository, branch: head
62-
module.compare = lambda repository, base, current: comparison or {}
62+
module.compare = lambda repository, base, current, patch_rules=None: comparison or {}
6363
return module.inspect_client("client", sample(), state or {})
6464
finally:
6565
module.current_head = old_head
@@ -73,6 +73,12 @@ def main() -> int:
7373
assert module.semantic_hits("+val item: StreamItem\n", ["StreamItem"]) == ["StreamItem"]
7474
assert module.semantic_hits("+selectedSubtitleId = null\n", ["StreamItem"]) == []
7575

76+
source = SCRIPT.read_text(encoding="utf-8")
77+
assert '"--clients"' in source
78+
assert "ThreadPoolExecutor" in source
79+
assert "parallel-git-ls-remote-plus-targeted-partial-tree-diff" in source
80+
assert "patch_files = [name for name in files if path_matches(name, patch_rules)]" in source
81+
7682
# The provider-to-screen contract must be guarded on every accepted client.
7783
# Mobile/Desktop already guard their complete features/streams surfaces; TV
7884
# must also treat its stream-selection UI as a hard contract because
@@ -206,13 +212,14 @@ def main() -> int:
206212
"unrelated_changed_files": ["README.md"],
207213
}
208214
}
209-
config = {"clients": {"client": sample()}}
215+
config = {"clients": {"client": sample(), "unselected": sample()}}
210216
advanced = module.apply_safe_state(payload, config, result, "2026-08-09T00:00:00+00:00")
211217
assert advanced == ["client"]
212218
saved = payload["nuvio_client_compatibility"]["clients"]["client"]
213219
assert saved["contract_ref"] == "a" * 40
214220
assert saved["accepted_ref"] == "c" * 40
215221
assert saved["acceptance"] == "automatic-contract-safe-advance"
222+
assert "unselected" not in payload["nuvio_client_compatibility"]["clients"]
216223

217224
print("Nuvio client upstream drift guard tests passed")
218225
return 0

0 commit comments

Comments
 (0)