Fix error messages and test assertions based on code review feedback

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-10 23:46:27 +00:00
parent 4447e949ab
commit 0d1f8d06c4
2 changed files with 5 additions and 4 deletions

View File

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

View File

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