test_provider_fallback.py python
33 lines 1.0 KB
Raw
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1 docs: MuseHub-first before ISR #74 — staging solidify NEXT Human 1 day ago
1 """Unit tests for provider fallback (§K5.8)."""
2
3 from __future__ import annotations
4
5 from pathlib import Path
6
7 from tests.support import FIXTURES, git_status_runner, run_cli, seed_freeze_repo, unreachable_provider_factory, write_config
8 from cli.kit_root import kit_root
9
10
11 def test_unreachable_provider_human_fallback(tmp_path: Path) -> None:
12 artifact = seed_freeze_repo(tmp_path)
13 code = run_cli(
14 ["review", "--freeze", str(artifact.relative_to(tmp_path)), "--json"],
15 cwd=tmp_path,
16 runner=git_status_runner(),
17 kit=kit_root(),
18 review_provider_factory=unreachable_provider_factory("offline"),
19 json_mode=True,
20 )
21 assert code == 8
22
23
24 def test_unreachable_never_passes(tmp_path: Path) -> None:
25 artifact = seed_freeze_repo(tmp_path)
26 code = run_cli(
27 ["review", "--freeze", str(artifact.relative_to(tmp_path))],
28 cwd=tmp_path,
29 runner=git_status_runner(),
30 kit=kit_root(),
31 review_provider_factory=unreachable_provider_factory(),
32 )
33 assert code != 0
File History 2 commits
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1 docs: MuseHub-first before ISR #74 — staging solidify NEXT Human 1 day ago
sha256:4671b7f787ddbe63ced31c895b688c77ab495653b65a730b423329f26b3c1439 feat: K1-P1 complete — agent provenance, build-verification… Sonnet 4.6 patch 52 days ago