fix: commit semantic repair changes
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
# [DEF:backend.tests.scripts.test_clean_release_tui:Module]
|
||||
# [DEF:TestCleanReleaseTui:Module]
|
||||
# @RELATION: BELONGS_TO -> SrcRoot
|
||||
# @COMPLEXITY: 3
|
||||
# @SEMANTICS: tests, tui, clean-release, curses
|
||||
# @PURPOSE: Unit tests for the interactive curses TUI of the clean release process.
|
||||
# @LAYER: Scripts
|
||||
# @RELATION: TESTS -> backend.src.scripts.clean_release_tui
|
||||
# @INVARIANT: TUI initializes, handles hotkeys (F5, F10) and safely falls back without TTY.
|
||||
|
||||
import os
|
||||
@@ -27,6 +27,8 @@ def mock_stdscr() -> MagicMock:
|
||||
return stdscr
|
||||
|
||||
|
||||
# [DEF:test_headless_fallback:Function]
|
||||
# @RELATION: BINDS_TO -> TestCleanReleaseTui
|
||||
def test_headless_fallback(capsys):
|
||||
"""
|
||||
@TEST_EDGE: stdout_unavailable
|
||||
@@ -44,7 +46,11 @@ def test_headless_fallback(capsys):
|
||||
assert "Use CLI/API workflow instead" in captured.err
|
||||
|
||||
|
||||
# [/DEF:test_headless_fallback:Function]
|
||||
|
||||
@patch("src.scripts.clean_release_tui.curses")
|
||||
# [DEF:test_tui_initial_render:Function]
|
||||
# @RELATION: BINDS_TO -> TestCleanReleaseTui
|
||||
def test_tui_initial_render(mock_curses_module, mock_stdscr: MagicMock):
|
||||
"""
|
||||
Simulates the initial rendering cycle of the TUI application to ensure
|
||||
@@ -77,7 +83,11 @@ def test_tui_initial_render(mock_curses_module, mock_stdscr: MagicMock):
|
||||
assert any("F5 Run" in str(call) for call in addstr_calls)
|
||||
|
||||
|
||||
# [/DEF:test_tui_initial_render:Function]
|
||||
|
||||
@patch("src.scripts.clean_release_tui.curses")
|
||||
# [DEF:test_tui_run_checks_f5:Function]
|
||||
# @RELATION: BINDS_TO -> TestCleanReleaseTui
|
||||
def test_tui_run_checks_f5(mock_curses_module, mock_stdscr: MagicMock):
|
||||
"""
|
||||
Simulates pressing F5 to transition into the RUNNING checks flow.
|
||||
@@ -112,7 +122,11 @@ def test_tui_run_checks_f5(mock_curses_module, mock_stdscr: MagicMock):
|
||||
assert len(app.violations_list) > 0
|
||||
|
||||
|
||||
# [/DEF:test_tui_run_checks_f5:Function]
|
||||
|
||||
@patch("src.scripts.clean_release_tui.curses")
|
||||
# [DEF:test_tui_exit_f10:Function]
|
||||
# @RELATION: BINDS_TO -> TestCleanReleaseTui
|
||||
def test_tui_exit_f10(mock_curses_module, mock_stdscr: MagicMock):
|
||||
"""
|
||||
Simulates pressing F10 to exit the application immediately without running checks.
|
||||
@@ -129,7 +143,11 @@ def test_tui_exit_f10(mock_curses_module, mock_stdscr: MagicMock):
|
||||
assert app.status == "READY"
|
||||
|
||||
|
||||
# [/DEF:test_tui_exit_f10:Function]
|
||||
|
||||
@patch("src.scripts.clean_release_tui.curses")
|
||||
# [DEF:test_tui_clear_history_f7:Function]
|
||||
# @RELATION: BINDS_TO -> TestCleanReleaseTui
|
||||
def test_tui_clear_history_f7(mock_curses_module, mock_stdscr: MagicMock):
|
||||
"""
|
||||
Simulates pressing F7 to clear history.
|
||||
@@ -153,11 +171,17 @@ def test_tui_clear_history_f7(mock_curses_module, mock_stdscr: MagicMock):
|
||||
assert len(app.checks_progress) == 0
|
||||
|
||||
|
||||
# [/DEF:test_tui_clear_history_f7:Function]
|
||||
|
||||
@patch("src.scripts.clean_release_tui.curses")
|
||||
# [DEF:test_tui_real_mode_bootstrap_imports_artifacts_catalog:Function]
|
||||
# @RELATION: BINDS_TO -> TestCleanReleaseTui
|
||||
def test_tui_real_mode_bootstrap_imports_artifacts_catalog(
|
||||
mock_curses_module,
|
||||
mock_stdscr: MagicMock,
|
||||
tmp_path,
|
||||
# [/DEF:test_tui_real_mode_bootstrap_imports_artifacts_catalog:Function]
|
||||
|
||||
):
|
||||
"""
|
||||
@TEST_CONTRACT: bootstrap.json + artifacts.json -> candidate PREPARED with imported artifacts
|
||||
@@ -220,4 +244,4 @@ def test_tui_real_mode_bootstrap_imports_artifacts_catalog(
|
||||
assert artifacts[0].detected_category == "core"
|
||||
|
||||
|
||||
# [/DEF:backend.tests.scripts.test_clean_release_tui:Module]
|
||||
# [/DEF:TestCleanReleaseTui:Module]
|
||||
|
||||
Reference in New Issue
Block a user