From 0d1f8d06c408538cd3fc8cf01fc5007f6b43163d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 10 Jan 2026 23:46:27 +0000 Subject: [PATCH] Fix error messages and test assertions based on code review feedback Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- backend/autometabuilder/tools/validate_workflows.py | 2 +- backend/tests/test_workflow_validation.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/autometabuilder/tools/validate_workflows.py b/backend/autometabuilder/tools/validate_workflows.py index 50fa6cd..bb6858e 100755 --- a/backend/autometabuilder/tools/validate_workflows.py +++ b/backend/autometabuilder/tools/validate_workflows.py @@ -9,7 +9,7 @@ try: import jsonschema from jsonschema import Draft202012Validator except ImportError: - print("Error: jsonschema library not found. Install with: poetry add jsonschema") + print("Error: jsonschema library not found. Install with: poetry install") sys.exit(1) diff --git a/backend/tests/test_workflow_validation.py b/backend/tests/test_workflow_validation.py index 8225062..94c6db3 100644 --- a/backend/tests/test_workflow_validation.py +++ b/backend/tests/test_workflow_validation.py @@ -99,7 +99,8 @@ def test_validate_workflow_with_missing_name(tmp_path): is_valid, error_msg = validate_workflow_file(workflow_file, schema) assert not is_valid - assert "name" in error_msg.lower() or "required" in error_msg.lower() + # jsonschema reports missing required property + assert "required" in error_msg.lower() or "'name'" in error_msg def test_validate_workflow_with_empty_nodes(tmp_path): @@ -116,8 +117,8 @@ def test_validate_workflow_with_empty_nodes(tmp_path): is_valid, error_msg = validate_workflow_file(workflow_file, schema) assert not is_valid - # jsonschema will report "[] should be non-empty" - assert "nodes" in error_msg.lower() or "empty" in error_msg.lower() + # jsonschema reports "[] is too short" for minItems violation + assert "too short" in error_msg.lower() and "nodes" in error_msg.lower() def test_validate_workflow_with_invalid_json(tmp_path):