Private
Public Access
0
0

test(fix): Update tests to route config through AppController/env var

Four test files had patches/monkeypatches that referenced the
removed src.models.load_config or src.models.CONFIG_PATH module
constant. These all stem from the config I/O refactor (commit
7bcb5a8c) that renamed load_config/save_config to private I/O
primitives.

- tests/test_external_editor_gui.py: 2 sites changed from
  monkeypatch.setattr(models_module, 'load_config', ...) to
  monkeypatch.setattr('src.app_controller.AppController.load_config', ...)
- tests/test_external_mcp_e2e.py: CONFIG_PATH monkeypatch changed
  to SLOP_CONFIG env var (the only supported override path)
- tests/test_log_management_ui.py: same CONFIG_PATH -> SLOP_CONFIG fix
- tests/test_gen_send_empty_context.py: _StubController now receives
  ui_selected_context_files and _pending_generation_action from the
  app_instance BEFORE being assigned as controller (App.__getattr__
  delegates to controller, so attrs must be on the stub first)

Also: deleted tests/artifacts/manualslop_layout.ini (gitignored
stale file from March 4 referencing pre-refactor window names like
"Projects"/"Files"/"Screenshots" that no longer exist in the code).
Repo-root manualslop_layout.ini still references the same old
window names; user should run the existing "Reset Layout" command
(or delete it manually) to regenerate with the current window
catalog (Context Hub / AI Settings Hub / Discussion Hub / etc.).

Verified: 13 targeted tests pass:
- test_external_editor_gui.py (5/5)
- test_external_mcp_e2e.py (1/1)
- test_log_management_ui.py (2/2)
- test_gen_send_empty_context.py (5/5)
This commit is contained in:
2026-06-07 21:21:38 -04:00
parent 7bcb5a8c07
commit 94cfb1b5ff
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ from src import models
async def test_external_mcp_e2e_refresh_and_call(tmp_path, monkeypatch):
# 1. Setup mock config and mock server script
config_file = tmp_path / "config.toml"
monkeypatch.setattr(models, "CONFIG_PATH", str(config_file))
monkeypatch.setenv("SLOP_CONFIG", str(config_file))
mock_script = Path("scripts/mock_mcp_server.py").absolute()