Skip to content

Commit

Permalink
test: add failing test for naming unexisting requested route
Browse files Browse the repository at this point in the history
  • Loading branch information
g0di committed Nov 2, 2024
1 parent b9769fb commit e054220
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_app_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,25 @@ def _() -> Any: # noqa: ANN401
# Then
assert_problem_response(resp, status=status)

@pytest.mark.xfail(reason="Not implemented yet")
def test_app_http_404_exception_returns_a_not_found_problem_details(self) -> None:
# Given
app = FastAPI()

problem.init_app(app)

# When
with TestClient(app, raise_server_exceptions=False) as test_client:
resp = test_client.post("/not-existing-route")

# Then
assert_problem_response(
resp,
status=status.HTTP_404_NOT_FOUND,
detail='Nothing matches the given URI: "/not-existing-route"',
uri="/not-existing-route",
)


class TestProblemResponse:
def test_app_problem_response_returns_a_problem_details(self, faker: Faker) -> None:
Expand Down

0 comments on commit e054220

Please sign in to comment.