Browse Source

test: add simple test for default 404 response

pull/14354/head
kiran gowda H A 8 months ago
parent
commit
067f0610e8
  1. 11
      tests/test_default_404.py

11
tests/test_default_404.py

@ -0,0 +1,11 @@
from fastapi import FastAPI
from fastapi.testclient import TestClient
def test_default_404():
app = FastAPI()
client = TestClient(app)
response = client.get("/non-existing-route")
assert response.status_code == 404
assert response.json()["detail"] == "Not Found"
Loading…
Cancel
Save