mirror of
https://github.com/rjNemo/fastapi
synced 2026-06-06 10:36:39 +00:00
17 lines
427 B
Python
17 lines
427 B
Python
from fastapi.testclient import TestClient
|
|
|
|
from wsgi.tutorial001 import app
|
|
|
|
client = TestClient(app)
|
|
|
|
|
|
def test_flask():
|
|
response = client.get("/v1/")
|
|
assert response.status_code == 200, response.text
|
|
assert response.text == "Hello, World from Flask!"
|
|
|
|
|
|
def test_app():
|
|
response = client.get("/v2")
|
|
assert response.status_code == 200, response.text
|
|
assert response.json() == {"message": "Hello World"}
|