test_gfg_d2_bridge_parse.py python
24 lines 799 B
Raw
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1 docs: MuseHub-first before ISR #74 — staging solidify NEXT Human 1 day ago
1 """Performance: bridge parse is file-local, no network (§D2F.9 performance)."""
2
3 from __future__ import annotations
4
5 import time
6 from pathlib import Path
7
8 from adapters.base import read_bridge_git_sha, read_bridge_muse_commit_id
9
10
11 def test_bridge_parse_bounded_and_local(tmp_path: Path) -> None:
12 tip = "sha256:" + ("f" * 64)
13 git_sha = "e" * 40
14 muse = tmp_path / ".muse"
15 muse.mkdir()
16 (muse / "git-bridge.toml").write_text(
17 f'[last_export]\nmuse_commit_id = "{tip}"\ngit_sha = "{git_sha}"\n',
18 encoding="utf-8",
19 )
20 start = time.perf_counter()
21 for _ in range(200):
22 assert read_bridge_muse_commit_id(tmp_path, "last_export") == tip
23 assert read_bridge_git_sha(tmp_path, "last_export") == git_sha
24 assert time.perf_counter() - start < 1.0
File History 1 commit
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1 docs: MuseHub-first before ISR #74 — staging solidify NEXT Human 1 day ago