Skip to content

Commit

Permalink
fix: bad request cannot contain \\n
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreiffers committed Oct 31, 2024
1 parent 3a815e4 commit c9ae717
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion static_rdf_server/routes/ontology.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ async def put_ontology(request: web.Request) -> web.Response: # noqa: C901
)
except NotValidFileContentException as e:
raise web.HTTPBadRequest(
reason=f'Ontology file "{part.filename}" has not valid content: {str(e)}.'
reason=f'Ontology file "{part.filename}" has not valid content.'
) from e

# For html-files We need to rewrite links to sub-folders:
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_put_ontology.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ async def test_put_ontology_file_not_readable(client: Any, fs: Any) -> None:

assert response.status == 400
body = await response.json()
assert f'Ontology file "{ontology}.ttl" has not valid content:' in body["detail"]
assert f'Ontology file "{ontology}.ttl" has not valid content' in body["detail"]


@pytest.mark.integration
Expand Down Expand Up @@ -544,7 +544,7 @@ async def test_put_ontology_rdf_file_not_parsable(client: Any, fs: Any) -> None:

assert response.status == 400
body = await response.json()
assert f'Ontology file "{ontology}.ttl" has not valid content:' in body["detail"]
assert f'Ontology file "{ontology}.ttl" has not valid content' in body["detail"]


@pytest.mark.integration
Expand Down

0 comments on commit c9ae717

Please sign in to comment.