test_workspace_exit_precedence.py file-level

at main · View file ↗ · Intel ↗

History
1 files
1 commits
0 hotspots
0 🧊 dead
0 💥 blast risk
sha256:8 docs: queue board-identity follow-ups so they survive the session Capt… · aaronrene · Sep 5, 2026
1 """Unit tests for status exit precedence with workspace relay (§MR.7.2)."""
2
3 from __future__ import annotations
4
5 from cli.commands.status import _exit_code_from_conditions
6
7
8 def test_exit_precedence_includes_workspace_relay() -> None:
9 assert (
10 _exit_code_from_conditions(
11 config_error=False,
12 integrity=None,
13 drift_status="ok",
14 use_exit_code=True,
15 workspace_ok=False,
16 )
17 == 35
18 )
19 # 6 beats 35
20 assert (
21 _exit_code_from_conditions(
22 config_error=False,
23 integrity="mismatch",
24 drift_status="ok",
25 use_exit_code=True,
26 workspace_ok=False,
27 )
28 == 6
29 )
30 # 2 beats 35
31 assert (
32 _exit_code_from_conditions(
33 config_error=True,
34 integrity=None,
35 drift_status="ok",
36 use_exit_code=True,
37 workspace_ok=False,
38 )
39 == 2
40 )
41 # 35 beats 3
42 assert (
43 _exit_code_from_conditions(
44 config_error=False,
45 integrity=None,
46 drift_status="behind",
47 use_exit_code=True,
48 workspace_ok=False,
49 )
50 == 35
51 )