summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_error_codes.py13
-rw-r--r--tests/test_transports.py12
2 files changed, 22 insertions, 3 deletions
diff --git a/tests/test_error_codes.py b/tests/test_error_codes.py
index 496ce84..eca73ad 100644
--- a/tests/test_error_codes.py
+++ b/tests/test_error_codes.py
@@ -82,6 +82,19 @@ def test_syntax_unexpected_token(compose_mml):
assert result["valid"] is True
+# --- SYNTAX_OUTSIDE_TRACK ---
+def test_syntax_outside_track_ppmck(compose_mml):
+ result = compose_mml(action="validate", mml="t120\nA l4\n c", mode="ppmck")
+ assert result["valid"] is True
+ assert _find_code(result, ErrorCode.SYNTAX_OUTSIDE_TRACK.value, "warnings")
+
+
+def test_syntax_outside_track_pyxel(compose_mml):
+ result = compose_mml(action="validate", mml="T120\n0: L4\n C", mode="pyxel")
+ assert result["valid"] is True
+ assert _find_code(result, ErrorCode.SYNTAX_OUTSIDE_TRACK.value, "warnings")
+
+
# --- SYNTAX_UNTERMINATED_REPEAT ---
def test_syntax_unterminated_repeat_pyxel(compose_mml):
result = compose_mml(action="validate", mml="0: T120 L4\n[ C D", mode="pyxel")
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():