Skip to content

Commit

Permalink
fixup! Issue #42 include backend id reference in validation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Dec 6, 2023
1 parent e230613 commit f895542
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/openeo_aggregator/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def validate(self, process_graph: dict, env: EvalEnv = None) -> List[dict]:
errors = [
{
"code": "UpstreamValidationInfo",
"message": f"Backend {con.id} reported validation errors",
"message": f"Backend {con.id!r} reported validation errors",
}
] + errors

Expand Down
6 changes: 3 additions & 3 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ def post_validation(request: requests.Request, context):
res = api100.post("/validation", json=post_data).assert_status_code(200)
assert res.json == {
"errors": [
{"code": "UpstreamValidationInfo", "message": "Backend b1 reported validation errors"},
{"code": "UpstreamValidationInfo", "message": "Backend 'b1' reported validation errors"},
{"code": "NoMath", "message": "No math support"},
]
}
Expand All @@ -1242,15 +1242,15 @@ def post_validation(request: requests.Request, context):
(
"S1",
[
{"code": "UpstreamValidationInfo", "message": "Backend b1 reported validation errors"},
{"code": "UpstreamValidationInfo", "message": "Backend 'b1' reported validation errors"},
{"code": "NoData", "message": "No data for S1"},
],
(1, 0),
),
(
"S2",
[
{"code": "UpstreamValidationInfo", "message": "Backend b2 reported validation errors"},
{"code": "UpstreamValidationInfo", "message": "Backend 'b2' reported validation errors"},
{"code": "NoData", "message": "No data for S2"},
],
(0, 1),
Expand Down

0 comments on commit f895542

Please sign in to comment.