From 4ed98f4ec8d354f8fdb009f0b7829c2628adb2a6 Mon Sep 17 00:00:00 2001 From: tanaka takashi Date: Sat, 11 Jul 2026 21:48:34 +0900 Subject: fix: stdio transport 起動時の TypeError 修正とトラック外コマンド警告の追加 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_transports.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tests/test_transports.py') diff --git a/tests/test_transports.py b/tests/test_transports.py index 395977b..a8bf12f 100644 --- a/tests/test_transports.py +++ b/tests/test_transports.py @@ -8,13 +8,15 @@ from mml_composemusic_mcp.server import main def test_transport_stdio_default(): - """Default transport should be stdio.""" + """Default transport should be stdio without host/port.""" with patch("sys.argv", ["server", "--output-dir", "./data"]): with patch("mml_composemusic_mcp.server.mcp.run") as mock_run: main() mock_run.assert_called_once() call_kwargs = mock_run.call_args assert call_kwargs[1]["transport"] == "stdio" + assert "host" not in call_kwargs[1] + assert "port" not in call_kwargs[1] def test_transport_http(): @@ -32,21 +34,25 @@ def test_transport_http(): def test_transport_sse(): - """SSE transport should be accepted.""" + """SSE transport should pass host and port.""" with patch("sys.argv", ["server", "--transport", "sse", "--port", "8080"]): with patch("mml_composemusic_mcp.server.mcp.run") as mock_run: main() call_kwargs = mock_run.call_args assert call_kwargs[1]["transport"] == "sse" + assert "host" in call_kwargs[1] + assert call_kwargs[1]["port"] == 8080 def test_transport_streamable_http(): - """Streamable HTTP transport should be accepted.""" + """Streamable HTTP transport should pass host and port.""" with patch("sys.argv", ["server", "--transport", "streamable-http"]): with patch("mml_composemusic_mcp.server.mcp.run") as mock_run: main() call_kwargs = mock_run.call_args assert call_kwargs[1]["transport"] == "streamable-http" + assert "host" in call_kwargs[1] + assert "port" in call_kwargs[1] def test_transport_invalid_rejected(): -- cgit v1.2.3