Coverage for docs_src/app_testing/test_main.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-08-08 03:53 +0000

1from fastapi.testclient import TestClient 1abcde

2 

3from .main import app 1abcde

4 

5client = TestClient(app) 1abcde

6 

7 

8def test_read_main(): 1abcde

9 response = client.get("/") 1abcde

10 assert response.status_code == 200 1abcde

11 assert response.json() == {"msg": "Hello World"} 1abcde