test_gfg_d2_bridge_sections.py
python
sha256:0e9549ec7b463911bc08b7d586dc320b1ac9b1f5c943ee7e3865dcc6cb0f6f83
chore(governance): sync handover+roadmap to 84db8c8 (drift:…
Human
1 day ago
| 1 | """Stress: bridge TOML with large unrelated sections (§D2F.9 stress).""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | from pathlib import Path |
| 6 | |
| 7 | from adapters.base import read_bridge_git_sha, read_bridge_muse_commit_id |
| 8 | |
| 9 | |
| 10 | def test_bridge_parsers_isolate_last_export_amid_noise(tmp_path: Path) -> None: |
| 11 | tip = "sha256:" + ("a" * 64) |
| 12 | git_sha = "b" * 40 |
| 13 | noise = "\n".join(f'noise_key_{i} = "x{i}"' for i in range(200)) |
| 14 | body = f"""[meta] |
| 15 | {noise} |
| 16 | |
| 17 | [last_import] |
| 18 | git_sha = "{"c" * 40}" |
| 19 | muse_commit_id = "sha256:{"d" * 64}" |
| 20 | {noise} |
| 21 | |
| 22 | [last_export] |
| 23 | muse_branch = "main" |
| 24 | muse_commit_id = "{tip}" |
| 25 | git_remote = "origin" |
| 26 | git_ref = "muse-mirror" |
| 27 | git_sha = "{git_sha}" |
| 28 | {noise} |
| 29 | |
| 30 | [other] |
| 31 | {noise} |
| 32 | """ |
| 33 | muse = tmp_path / ".muse" |
| 34 | muse.mkdir() |
| 35 | (muse / "git-bridge.toml").write_text(body, encoding="utf-8") |
| 36 | assert read_bridge_muse_commit_id(tmp_path, "last_export") == tip |
| 37 | assert read_bridge_git_sha(tmp_path, "last_export") == git_sha |
| 38 | assert read_bridge_muse_commit_id(tmp_path, "last_import") == "sha256:" + ("d" * 64) |
File History
1 commit
sha256:6abcf1fa82a7a621ccbc945f19acdba5bc0db54569599404a1452fb4a096a199
fix(ISR): default require_independent_second_reviewer to require
Human
minor
⚠
1 day ago