- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for test_events (0.08 sec)
-
tests/test_tutorial/test_events/test_tutorial003.py
from fastapi.testclient import TestClient from docs_src.events.tutorial003 import ( app, fake_answer_to_everything_ml_model, ml_models, ) def test_events(): assert not ml_models, "ml_models should be empty" with TestClient(app) as client: assert ml_models["answer_to_everything"] == fake_answer_to_everything_ml_model response = client.get("/predict", params={"x": 2})
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 3.6K bytes - Viewed (0) -
tests/test_tutorial/test_events/test_tutorial002.py
@pytest.fixture(name="app", scope="module") def get_app(): with pytest.warns(DeprecationWarning): from docs_src.events.tutorial002 import app yield app def test_events(app: FastAPI): with TestClient(app) as client: response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [{"name": "Foo"}]
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 18 12:36:40 UTC 2023 - 1.4K bytes - Viewed (0) -
tests/test_tutorial/test_events/test_tutorial001.py
@pytest.fixture(name="app", scope="module") def get_app(): with pytest.warns(DeprecationWarning): from docs_src.events.tutorial001 import app yield app def test_events(app: FastAPI): with TestClient(app) as client: response = client.get("/items/foo") assert response.status_code == 200, response.text assert response.json() == {"name": "Fighters"}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 18 12:36:40 UTC 2023 - 3.6K bytes - Viewed (0)