test_provider_fallback.py python
33 lines 1.0 KB
Raw
sha256:c07f2f34a0db9f43fe866f157d1935322008545ff8940c06c7c921eb219c55ab NXP-b DONE: independent BV-r2 pass + ISR (SD-17) Human minor ⚠ breaking 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 1 commit
sha256:c07f2f34a0db9f43fe866f157d1935322008545ff8940c06c7c921eb219c55ab NXP-b DONE: independent BV-r2 pass + ISR (SD-17) Human minor 1 day ago