Update test

This commit is contained in:
Lorhan Sohaky 2022-03-06 13:14:24 -03:00
parent c71016a19b
commit 54b734e015
1 changed files with 8 additions and 3 deletions

View File

@ -9,14 +9,18 @@ sub_app = FastAPI(
docs_url=None,
redoc_url=None,
openapi_url=None,
)
)
@sub_app.get("/items/")
async def read_items():
return {"id": "foo"}
@sub_app.get("/openapi.json")
async def openapi():
async def openapi(
# Custom Deps
):
return get_openapi(
title="Custom OpenAPI",
version="0.1",
@ -36,4 +40,5 @@ def test_sub_app_open_api():
assert response.headers["content-type"] == "application/json"
paths = list(response.json()["paths"].keys())
assert paths == [
"/sub_app/items/", "/sub_app/openapi.json",]
"/sub_app/items/", "/sub_app/openapi.json"
]