summaryrefslogtreecommitdiff
path: root/tests/test_transports.py
diff options
context:
space:
mode:
authortanaka takashi <isazaka@gmail.com>2026-07-11 21:48:34 +0900
committertanaka takashi <isazaka@gmail.com>2026-07-11 21:48:34 +0900
commit4ed98f4ec8d354f8fdb009f0b7829c2628adb2a6 (patch)
tree07fd47ae951fa3ad776834e4876764adb09d5068 /tests/test_transports.py
parent79cd969c98893e04382fe6075f420589c3a1652e (diff)
fix: stdio transport 起動時の TypeError 修正とトラック外コマンド警告の追加
Diffstat (limited to 'tests/test_transports.py')
-rw-r--r--tests/test_transports.py12
1 files changed, 9 insertions, 3 deletions
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():