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:
co-authored by
Claude Opus 4.6
parent
e9c46a04a0
commit
1af85bc05e
@@ -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 .calendar import configure_calendar_tools
|
||||||
from .collectives import configure_collectives_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).
|
# 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
|
# Semantic search is excluded here because it is a cross-app feature gated
|
||||||
# by VECTOR_SYNC_ENABLED, not an individual Nextcloud app.
|
# 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,
|
"notes": configure_notes_tools,
|
||||||
"tables": configure_tables_tools,
|
"tables": configure_tables_tools,
|
||||||
"webdav": configure_webdav_tools,
|
"webdav": configure_webdav_tools,
|
||||||
|
|||||||
@@ -318,10 +318,6 @@ def test_stdio_calls_get_stdio_mcp(runner, clean_env, monkeypatch):
|
|||||||
called_with["enabled_apps"] = enabled_apps
|
called_with["enabled_apps"] = enabled_apps
|
||||||
return FakeMcp()
|
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)
|
monkeypatch.setattr("nextcloud_mcp_server.stdio.get_stdio_mcp", mock_get_stdio_mcp)
|
||||||
|
|
||||||
result = runner.invoke(run, ["--transport", "stdio"])
|
result = runner.invoke(run, ["--transport", "stdio"])
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ def single_user_env(monkeypatch):
|
|||||||
# Ensure multi-user mode is off (may leak from other tests)
|
# Ensure multi-user mode is off (may leak from other tests)
|
||||||
monkeypatch.delenv("ENABLE_MULTI_USER_BASIC_AUTH", raising=False)
|
monkeypatch.delenv("ENABLE_MULTI_USER_BASIC_AUTH", raising=False)
|
||||||
_reload_config()
|
_reload_config()
|
||||||
|
yield
|
||||||
|
_reload_config()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
|
|||||||
Reference in New Issue
Block a user