- Sort Score
- Result 10 results
- Languages All
Results 11 - 13 of 13 for test_get_item_2 (0.12 sec)
-
tests/test_tutorial/test_handling_errors/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.handling_errors.tutorial001 import app client = TestClient(app) def test_get_item(): response = client.get("/items/foo") assert response.status_code == 200, response.text assert response.json() == {"item": "The Foo Wrestlers"} def test_get_item_not_found(): response = client.get("/items/bar") assert response.status_code == 404, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 3.2K bytes - Viewed (0) -
tests/test_tutorial/test_generate_clients/test_tutorial003.py
"/users/", json={"username": "Foo", "email": "******@****.***"} ) assert response.status_code == 200, response.text assert response.json() == {"message": "User received"} def test_get_items(): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [ {"name": "Plumbus", "price": 3}, {"name": "Portal Gun", "price": 9001},
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 7.1K bytes - Viewed (0) -
tests/test_starlette_exception.py
if item_id not in items: raise StarletteHTTPException(status_code=404, detail="Item not found") return {"item": items[item_id]} client = TestClient(app) def test_get_item(): response = client.get("/items/foo") assert response.status_code == 200, response.text assert response.json() == {"item": "The Foo Wrestlers"} def test_get_item_not_found():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 7.4K bytes - Viewed (0)