semantics
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# [DEF:test_clean_release_tui_v2:Module]
|
||||
# @RELATION: BELONGS_TO -> SrcRoot
|
||||
# #region test_clean_release_tui_v2 [C:2] [TYPE Module]
|
||||
# @RELATION BINDS_TO -> SrcRoot
|
||||
# @PURPOSE: Smoke tests for thin-client TUI action dispatch and blocked transition behavior.
|
||||
# @LAYER: Domain
|
||||
# @LAYER Domain
|
||||
|
||||
"""Smoke tests for the redesigned clean release TUI."""
|
||||
|
||||
@@ -14,8 +14,8 @@ from src.models.clean_release import CheckFinalStatus
|
||||
from src.scripts.clean_release_tui import CleanReleaseTUI, main
|
||||
|
||||
|
||||
# [DEF:_build_mock_stdscr:Function]
|
||||
# @RELATION: BINDS_TO -> test_clean_release_tui_v2
|
||||
# #region _build_mock_stdscr [C:2] [TYPE Function]
|
||||
# @RELATION BINDS_TO -> test_clean_release_tui_v2
|
||||
# @PURPOSE: Build deterministic curses screen mock with default terminal geometry and exit key.
|
||||
def _build_mock_stdscr() -> MagicMock:
|
||||
stdscr = MagicMock()
|
||||
@@ -24,12 +24,12 @@ def _build_mock_stdscr() -> MagicMock:
|
||||
return stdscr
|
||||
|
||||
|
||||
# [/DEF:_build_mock_stdscr:Function]
|
||||
# #endregion _build_mock_stdscr
|
||||
|
||||
|
||||
@patch("src.scripts.clean_release_tui.curses")
|
||||
# [DEF:test_tui_f5_dispatches_run_action:Function]
|
||||
# @RELATION: BINDS_TO -> test_clean_release_tui_v2
|
||||
# #region test_tui_f5_dispatches_run_action [C:2] [TYPE Function]
|
||||
# @RELATION BINDS_TO -> test_clean_release_tui_v2
|
||||
# @PURPOSE: Verify F5 key dispatch invokes run_checks exactly once before graceful exit.
|
||||
def test_tui_f5_dispatches_run_action(mock_curses_module: MagicMock) -> None:
|
||||
"""F5 should dispatch run action from TUI loop."""
|
||||
@@ -48,12 +48,12 @@ def test_tui_f5_dispatches_run_action(mock_curses_module: MagicMock) -> None:
|
||||
run_checks_mock.assert_called_once_with()
|
||||
|
||||
|
||||
# [/DEF:test_tui_f5_dispatches_run_action:Function]
|
||||
# #endregion test_tui_f5_dispatches_run_action
|
||||
|
||||
|
||||
@patch("src.scripts.clean_release_tui.curses")
|
||||
# [DEF:test_tui_f5_run_smoke_reports_blocked_state:Function]
|
||||
# @RELATION: BINDS_TO -> test_clean_release_tui_v2
|
||||
# #region test_tui_f5_run_smoke_reports_blocked_state [C:2] [TYPE Function]
|
||||
# @RELATION BINDS_TO -> test_clean_release_tui_v2
|
||||
# @PURPOSE: Verify blocked compliance state is surfaced after F5-triggered run action.
|
||||
def test_tui_f5_run_smoke_reports_blocked_state(mock_curses_module: MagicMock) -> None:
|
||||
"""F5 smoke test should expose blocked outcome state after run action."""
|
||||
@@ -79,11 +79,11 @@ def test_tui_f5_run_smoke_reports_blocked_state(mock_curses_module: MagicMock) -
|
||||
assert app.violations_list
|
||||
|
||||
|
||||
# [/DEF:test_tui_f5_run_smoke_reports_blocked_state:Function]
|
||||
# #endregion test_tui_f5_run_smoke_reports_blocked_state
|
||||
|
||||
|
||||
# [DEF:test_tui_non_tty_refuses_startup:Function]
|
||||
# @RELATION: BINDS_TO -> test_clean_release_tui_v2
|
||||
# #region test_tui_non_tty_refuses_startup [C:2] [TYPE Function]
|
||||
# @RELATION BINDS_TO -> test_clean_release_tui_v2
|
||||
# @PURPOSE: Verify non-TTY execution returns exit code 2 with actionable stderr guidance.
|
||||
def test_tui_non_tty_refuses_startup(capsys) -> None:
|
||||
"""Non-TTY startup must refuse TUI mode and redirect operator to CLI/API flow."""
|
||||
@@ -96,12 +96,12 @@ def test_tui_non_tty_refuses_startup(capsys) -> None:
|
||||
assert "Use CLI/API workflow instead" in captured.err
|
||||
|
||||
|
||||
# [/DEF:test_tui_non_tty_refuses_startup:Function]
|
||||
# #endregion test_tui_non_tty_refuses_startup
|
||||
|
||||
|
||||
@patch("src.scripts.clean_release_tui.curses")
|
||||
# [DEF:test_tui_f8_blocked_without_facade_binding:Function]
|
||||
# @RELATION: BINDS_TO -> test_clean_release_tui_v2
|
||||
# #region test_tui_f8_blocked_without_facade_binding [C:2] [TYPE Function]
|
||||
# @RELATION BINDS_TO -> test_clean_release_tui_v2
|
||||
# @PURPOSE: Verify F8 path reports disabled action instead of mutating hidden facade state.
|
||||
def test_tui_f8_blocked_without_facade_binding(mock_curses_module: MagicMock) -> None:
|
||||
"""F8 should not perform hidden state mutation when facade action is not bound."""
|
||||
@@ -120,5 +120,5 @@ def test_tui_f8_blocked_without_facade_binding(mock_curses_module: MagicMock) ->
|
||||
assert "F8 disabled" in app.last_error
|
||||
|
||||
|
||||
# [/DEF:test_tui_f8_blocked_without_facade_binding:Function]
|
||||
# [/DEF:test_clean_release_tui_v2:Module]
|
||||
# #endregion test_tui_f8_blocked_without_facade_binding
|
||||
# #endregion test_clean_release_tui_v2
|
||||
|
||||
Reference in New Issue
Block a user