From e16782c208320138d77b88f2ff359e3e9e059e76 Mon Sep 17 00:00:00 2001 From: tanaka takashi Date: Sat, 11 Jul 2026 19:57:02 +0900 Subject: fix: レビュー指摘事項の修正(エラー戻り値統一、タイ延長、ネストリピート、専用エラーコード) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit High severity: - compose action エラー戻り値の validation キー統一(server.py) - ppmck/pyxel タイ & の duration 延長修正(_tie_pending フラグ導入) - pyxel ネストリピート対応(RepeatFrame + イベントスナップショット方式) Medium severity: - 専用エラーコード追加: VALIDATION_MISSING_PARAMETER, VALIDATION_INVALID_MODE, VALIDATION_INVALID_ACTION - SYSTEM_INTERNAL_ERROR キャッチ範囲拡大(compose/validate全体をtry/except) Low severity: - 設計書 line/column を1始まりに明記、APIレベルエラーコード追記 テスト: 129 passed, ruff: All checks passed --- tests/test_compose_mml_tool.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/test_compose_mml_tool.py') diff --git a/tests/test_compose_mml_tool.py b/tests/test_compose_mml_tool.py index af1e3e2..eb1b093 100644 --- a/tests/test_compose_mml_tool.py +++ b/tests/test_compose_mml_tool.py @@ -85,13 +85,13 @@ def test_template_invalid_fallback(compose_mml): def test_compose_missing_mml(compose_mml): result = compose_mml(action="compose", mml="", mode="ppmck") assert result["success"] is False - assert any(e["severity"] == "error" for e in result["errors"]) + assert any(e["severity"] == "error" for e in result["validation"]["errors"]) def test_compose_missing_mode(compose_mml): result = compose_mml(action="compose", mml="A c", mode="") assert result["success"] is False - assert any(e["severity"] == "error" for e in result["errors"]) + assert any(e["severity"] == "error" for e in result["validation"]["errors"]) def test_validate_missing_mode(compose_mml): @@ -103,7 +103,7 @@ def test_compose_unknown_mode(compose_mml): result = compose_mml(action="compose", mml="A c", mode="xyz") assert result["success"] is False assert any( - e["code"] == "SYNTAX_INVALID_TOKEN" for e in result["validation"]["errors"] + e["code"] == "VALIDATION_INVALID_MODE" for e in result["validation"]["errors"] ) @@ -127,7 +127,7 @@ def test_compose_with_warning(compose_mml, tmp_output_dir): def test_action_invalid(compose_mml): result = compose_mml(action="unknown") assert result["success"] is False - assert any("action" in e["message"] for e in result["errors"]) + assert any("action" in e["message"] for e in result["validation"]["errors"]) def test_compose_sample_rates(compose_mml, tmp_output_dir): -- cgit v1.2.3