test_provider_fallback.py
python
sha256:8d7f41aafae41deee70035a92f93602ef1722a290153597451e5932af503a42c
docs: queue board-identity follow-ups so they survive the session
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
1 commit
sha256:8d7f41aafae41deee70035a92f93602ef1722a290153597451e5932af503a42c
docs: queue board-identity follow-ups so they survive the session
Human
1 day ago