fix: address second round of review feedback

- Remove dead monkeypatch in test_stdio_calls_get_stdio_mcp
- Add _reload_config() teardown to single_user_env fixture
- Tighten AVAILABLE_APPS type to Callable[[FastMCP], None]

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-04-07 23:26:46 +02:00
co-authored by Claude Opus 4.6
parent e9c46a04a0
commit 1af85bc05e
3 changed files with 6 additions and 6 deletions
+4 -2
View File
@@ -1,4 +1,6 @@
from typing import Callable
from collections.abc import Callable
from mcp.server.fastmcp import FastMCP
from .calendar import configure_calendar_tools
from .collectives import configure_collectives_tools
@@ -16,7 +18,7 @@ from .webdav import configure_webdav_tools
# Used by app.py (HTTP), stdio.py (stdio), and cli.py (--enable-app choices).
# Semantic search is excluded here because it is a cross-app feature gated
# by VECTOR_SYNC_ENABLED, not an individual Nextcloud app.
AVAILABLE_APPS: dict[str, Callable] = {
AVAILABLE_APPS: dict[str, Callable[[FastMCP], None]] = {
"notes": configure_notes_tools,
"tables": configure_tables_tools,
"webdav": configure_webdav_tools,
-4
View File
@@ -318,10 +318,6 @@ def test_stdio_calls_get_stdio_mcp(runner, clean_env, monkeypatch):
called_with["enabled_apps"] = enabled_apps
return FakeMcp()
monkeypatch.setattr(
"nextcloud_mcp_server.cli.get_stdio_mcp", mock_get_stdio_mcp, raising=False
)
# The lazy import means we need to patch at the module level it imports from
monkeypatch.setattr("nextcloud_mcp_server.stdio.get_stdio_mcp", mock_get_stdio_mcp)
result = runner.invoke(run, ["--transport", "stdio"])
+2
View File
@@ -17,6 +17,8 @@ def single_user_env(monkeypatch):
# Ensure multi-user mode is off (may leak from other tests)
monkeypatch.delenv("ENABLE_MULTI_USER_BASIC_AUTH", raising=False)
_reload_config()
yield
_reload_config()
@pytest.mark.unit