fix: v0.4.1 — remove pause_container / unpause_container (DSM unsupported)

Live test on this DSM firmware: SYNO.Docker.Container has no pause/
unpause method ("Method does not exist"). The Container Manager GUI
action menu only exposes Start / Stop / Force-Stop / Restart / Reset —
pause/resume simply isn't a feature here.

The two tools were briefly shipped in 0.4.0 (implemented by symmetry
with the verified stop call) and have now been removed rather than
left as a broken surface. The remaining lifecycle tools
(start_container, stop_container, restart_container) are unaffected.

Tool count: 33 → 31. Closes #7 (won't fix — DSM limitation).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-18 12:52:52 +02:00
parent 12d532da7b
commit 24b97338ba
6 changed files with 28 additions and 53 deletions
+4 -10
View File
@@ -707,28 +707,26 @@ async def test_container_stats_no_precpu_graceful():
# ──────────────────────────────────────────────────────────────────────────────
# Lifecycle: start / stop / restart / pause / unpause
# Lifecycle: start / stop / restart
# ──────────────────────────────────────────────────────────────────────────────
# Tools that don't have a confirmation gate
_NO_CONFIRM_LIFECYCLE = [
("start_container", "start", "Started"),
("unpause_container", "unpause", "Unpaused"),
]
# Tools that require confirmed=True
_CONFIRM_LIFECYCLE = [
("stop_container", "stop", "Stopped", "stop"),
("restart_container", "restart", "Restarted", "restart"),
("pause_container", "pause", "Paused", "pause"),
]
@pytest.mark.parametrize("tool_name, dsm_method, success_word", _NO_CONFIRM_LIFECYCLE)
@pytest.mark.asyncio
async def test_lifecycle_no_confirm_calls_dsm(tool_name, dsm_method, success_word):
"""start_container and unpause_container call DSM directly with json-encoded name."""
"""start_container calls DSM directly with json-encoded name."""
from mcp_synology_container.modules.containers import register_containers
client = AsyncMock()
@@ -753,7 +751,7 @@ async def test_lifecycle_no_confirm_calls_dsm(tool_name, dsm_method, success_wor
@pytest.mark.parametrize("tool_name, dsm_method, success_word, _action", _CONFIRM_LIFECYCLE)
@pytest.mark.asyncio
async def test_lifecycle_confirmed_calls_dsm(tool_name, dsm_method, success_word, _action):
"""stop/restart/pause call DSM with confirmed=True using json-encoded name."""
"""stop/restart call DSM with confirmed=True using json-encoded name."""
from mcp_synology_container.modules.containers import register_containers
client = AsyncMock()
@@ -779,7 +777,7 @@ async def test_lifecycle_confirmed_calls_dsm(tool_name, dsm_method, success_word
async def test_lifecycle_preview_without_confirmation(
tool_name, _dsm_method, _success_word, action
):
"""stop/restart/pause without confirmed=True must NOT call DSM."""
"""stop/restart without confirmed=True must NOT call DSM."""
from mcp_synology_container.modules.containers import register_containers
client = AsyncMock()
@@ -799,10 +797,8 @@ async def test_lifecycle_preview_without_confirmation(
"tool_name, dsm_method, kwargs",
[
("start_container", "start", {}),
("unpause_container", "unpause", {}),
("stop_container", "stop", {"confirmed": True}),
("restart_container", "restart", {"confirmed": True}),
("pause_container", "pause", {"confirmed": True}),
],
)
@pytest.mark.asyncio
@@ -836,10 +832,8 @@ async def test_lifecycle_resolves_hash_prefix(tool_name, dsm_method, kwargs):
"tool_name, kwargs, error_verb",
[
("start_container", {}, "starting"),
("unpause_container", {}, "unpausing"),
("stop_container", {"confirmed": True}, "stopping"),
("restart_container", {"confirmed": True}, "restarting"),
("pause_container", {"confirmed": True}, "pausing"),
],
)
@pytest.mark.asyncio