2020-07-10 11:08:19 +02:00
|
|
|
from docs_src.app_testing.test_main import client, test_read_main
|
2019-04-12 20:15:05 +04:00
|
|
|
|
2023-05-08 23:07:32 +02:00
|
|
|
|
|
|
|
|
def test_main():
|
|
|
|
|
test_read_main()
|
2019-04-12 20:15:05 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_openapi_schema():
|
|
|
|
|
response = client.get("/openapi.json")
|
2020-04-08 05:37:38 +01:00
|
|
|
assert response.status_code == 200, response.text
|
2023-05-08 23:07:32 +02:00
|
|
|
assert response.json() == {
|
2023-06-30 20:25:16 +02:00
|
|
|
"openapi": "3.1.0",
|
2023-05-08 23:07:32 +02:00
|
|
|
"info": {"title": "FastAPI", "version": "0.1.0"},
|
|
|
|
|
"paths": {
|
|
|
|
|
"/": {
|
|
|
|
|
"get": {
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "Successful Response",
|
|
|
|
|
"content": {"application/json": {"schema": {}}},
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"summary": "Read Main",
|
|
|
|
|
"operationId": "read_main__get",
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
}
|