From 62b260d1f24d8db06e734a3b79bb0ad08393c056 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Fri, 19 Jun 2026 16:24:01 -0400 Subject: [PATCH] test(app_controller_sigint): update _FakeController for Phase 6 Result-based helpers The Phase 6 Group 6.1 migration changed _install_sigint_exit_handler to call controller._install_signal_handler_result(handler) and controller._shutdown_io_pool_result(). The _FakeController test stub needs to provide these new helpers to maintain the test contract. --- tests/test_app_controller_sigint.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tests/test_app_controller_sigint.py b/tests/test_app_controller_sigint.py index 60b31907..6cd33a80 100644 --- a/tests/test_app_controller_sigint.py +++ b/tests/test_app_controller_sigint.py @@ -49,12 +49,38 @@ def restore_sigint(): class _FakeController: - """Minimal stand-in for AppController: just exposes _io_pool.""" + """Minimal stand-in for AppController: just exposes _io_pool + the + Result-based signal-handler helpers added in Phase 6 Group 6.1.""" def __init__(self) -> None: self._io_pool = ThreadPoolExecutor( max_workers=2, thread_name_prefix="fake-ctrl" ) + self._signal_handler_error = None + + def _shutdown_io_pool_result(self): + """Phase 6 Group 6.1 helper (Result-based).""" + from src.result_types import OK, ErrorInfo, ErrorKind, Result + try: + self._io_pool.shutdown(wait=False) + return OK + except Exception as e: + return Result(data=None, errors=[ErrorInfo( + kind=ErrorKind.INTERNAL, message=str(e), + source="app_controller._shutdown_io_pool_result", original=e, + )]) + + def _install_signal_handler_result(self, handler): + """Phase 6 Group 6.1 helper (Result-based).""" + from src.result_types import OK, ErrorInfo, ErrorKind, Result + try: + signal.signal(signal.SIGINT, handler) + return OK + except Exception as e: + return Result(data=None, errors=[ErrorInfo( + kind=ErrorKind.INTERNAL, message=str(e), + source="app_controller._install_signal_handler_result", original=e, + )]) def test_install_sigint_handler_installs_callable(restore_sigint: Any) -> None: