Files
fastapi__fastapi/docs/src/app_testing/test_main.py
T
Sebastián Ramírez 46e3811f8d ✨ Add testing docs and tests (#151)
* ✏️ Fix typo in security intro

* ✨ Add testing docs and tests

* 🐛 Debug Travis coverage

* 🐛 Debug Travis coverage, report XML

* 💚 Make Travis/Flit use same code install

* ⏪ Revert Travis/Codecov debugging changes
2019-04-12 20:15:05 +04:00

12 lines
240 B
Python

from starlette.testclient import TestClient
from .main import app
client = TestClient(app)
def test_read_main():
response = client.get("/")
assert response.status_code == 200
assert response.json() == {"msg": "Hello World"}