fix: commit semantic repair changes
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
# [DEF:test_clean_release_tui_v2:Module]
|
||||
# @RELATION: BELONGS_TO -> SrcRoot
|
||||
# @COMPLEXITY: 3
|
||||
# @PURPOSE: Smoke tests for thin-client TUI action dispatch and blocked transition behavior.
|
||||
# @LAYER: Domain
|
||||
# @RELATION: TESTS -> backend.src.scripts.clean_release_tui
|
||||
|
||||
"""Smoke tests for the redesigned clean release TUI."""
|
||||
|
||||
@@ -15,6 +15,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
|
||||
def _build_mock_stdscr() -> MagicMock:
|
||||
stdscr = MagicMock()
|
||||
stdscr.getmaxyx.return_value = (40, 120)
|
||||
@@ -22,7 +24,11 @@ def _build_mock_stdscr() -> MagicMock:
|
||||
return stdscr
|
||||
|
||||
|
||||
# [/DEF:_build_mock_stdscr:Function]
|
||||
|
||||
@patch("src.scripts.clean_release_tui.curses")
|
||||
# [DEF:test_tui_f5_dispatches_run_action:Function]
|
||||
# @RELATION: BINDS_TO -> test_clean_release_tui_v2
|
||||
def test_tui_f5_dispatches_run_action(mock_curses_module: MagicMock) -> None:
|
||||
"""F5 should dispatch run action from TUI loop."""
|
||||
mock_curses_module.KEY_F10 = curses.KEY_F10
|
||||
@@ -40,7 +46,11 @@ 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]
|
||||
|
||||
@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
|
||||
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."""
|
||||
mock_curses_module.KEY_F10 = curses.KEY_F10
|
||||
@@ -65,6 +75,10 @@ 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]
|
||||
|
||||
# [DEF:test_tui_non_tty_refuses_startup:Function]
|
||||
# @RELATION: BINDS_TO -> test_clean_release_tui_v2
|
||||
def test_tui_non_tty_refuses_startup(capsys) -> None:
|
||||
"""Non-TTY startup must refuse TUI mode and redirect operator to CLI/API flow."""
|
||||
with patch("sys.stdout.isatty", return_value=False):
|
||||
@@ -76,7 +90,11 @@ 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]
|
||||
|
||||
@patch("src.scripts.clean_release_tui.curses")
|
||||
# [DEF:test_tui_f8_blocked_without_facade_binding:Function]
|
||||
# @RELATION: BINDS_TO -> test_clean_release_tui_v2
|
||||
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."""
|
||||
mock_curses_module.KEY_F10 = curses.KEY_F10
|
||||
@@ -95,3 +113,4 @@ def test_tui_f8_blocked_without_facade_binding(mock_curses_module: MagicMock) ->
|
||||
|
||||
|
||||
# [/DEF:test_clean_release_tui_v2:Module]
|
||||
# [/DEF:test_tui_f8_blocked_without_facade_binding:Function]
|
||||
|
||||
Reference in New Issue
Block a user