Debian Codegraph @

tests/test_tutorial/test_testing/test_tutorial001.py

raw
1 from inline_snapshot import snapshot
2
3 from docs_src.app_testing.tutorial001_py310 import client, test_read_main
4
5
6 def test_main():
7 test_read_main()
8
9
10 def test_openapi_schema():
11 response = client.get("/openapi.json")
12 assert response.status_code == 200, response.text
13 assert response.json() == snapshot(
14 {
15 "openapi": "3.1.0",
16 "info": {"title": "FastAPI", "version": "0.1.0"},
17 "paths": {
18 "/": {
19 "get": {
20 "responses": {
21 "200": {
22 "description": "Successful Response",
23 "content": {"application/json": {"schema": {}}},
24 }
25 },
26 "summary": "Read Main",
27 "operationId": "read_main__get",
28 }
29 }
30 },
31 }
32 )