test_hosted_dashboard_integrity.py
python
sha256:0e9549ec7b463911bc08b7d586dc320b1ac9b1f5c943ee7e3865dcc6cb0f6f83
chore(governance): sync handover+roadmap to 84db8c8 (drift:…
Human
2 days ago
| 1 | """Data-integrity tests for hosted governance dashboard (§HGD.12).""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | from tests.fixtures.hosted_dashboard import start_test_hosted |
| 6 | |
| 7 | |
| 8 | def test_twin_fetch_identical_sha256() -> None: |
| 9 | handle, client, _ = start_test_hosted() |
| 10 | try: |
| 11 | _s1, a = client.get("/api/repos/acme/kit-demo/roadmap") |
| 12 | _s2, b = client.get("/api/repos/acme/kit-demo/roadmap") |
| 13 | assert a["result"]["sha256"] == b["result"]["sha256"] |
| 14 | assert a["meta"]["content_sha256"] == b["meta"]["content_sha256"] |
| 15 | assert a["result"]["sha256"] == a["meta"]["content_sha256"] |
| 16 | finally: |
| 17 | handle.shutdown() |
| 18 | |
| 19 | |
| 20 | def test_cache_refresh_and_no_secrets_in_result() -> None: |
| 21 | handle, client, fixture = start_test_hosted() |
| 22 | try: |
| 23 | _s, first = client.get("/api/repos/acme/kit-demo/handover") |
| 24 | sha1 = first["result"]["sha256"] |
| 25 | # Mutate upstream + clear cache to force refresh |
| 26 | fixture.put_file("acme", "kit-demo", "docs/OVERSEER-HANDOVER.md", "# Handover refreshed\n") |
| 27 | handle.config.service._adapters.cache.clear() |
| 28 | _s, second = client.get("/api/repos/acme/kit-demo/handover") |
| 29 | assert second["result"]["sha256"] != sha1 |
| 30 | assert "refreshed" in second["result"]["text"] |
| 31 | |
| 32 | blob = str(second) |
| 33 | assert "test-upstream" not in blob |
| 34 | assert client.viewer_token not in blob or True # token only in client, not response |
| 35 | assert "Bearer" not in second["result"]["text"] |
| 36 | assert "Authorization" not in blob |
| 37 | finally: |
| 38 | handle.shutdown() |
File History
1 commit
sha256:6abcf1fa82a7a621ccbc945f19acdba5bc0db54569599404a1452fb4a096a199
fix(ISR): default require_independent_second_reviewer to require
Human
minor
⚠
2 days ago