Coverage for tests/test_tutorial/test_testing/test_main.py: 100%
7 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
1from docs_src.app_testing.test_main import client, test_read_main 1abcde
4def test_main(): 1abcde
5 test_read_main() 1abcde
8def test_openapi_schema(): 1abcde
9 response = client.get("/openapi.json") 1abcde
10 assert response.status_code == 200, response.text 1abcde
11 assert response.json() == { 1abcde
12 "openapi": "3.1.0",
13 "info": {"title": "FastAPI", "version": "0.1.0"},
14 "paths": {
15 "/": {
16 "get": {
17 "responses": {
18 "200": {
19 "description": "Successful Response",
20 "content": {"application/json": {"schema": {}}},
21 }
22 },
23 "summary": "Read Main",
24 "operationId": "read_main__get",
25 }
26 }
27 },
28 }