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):