- Sort Score
- Result 10 results
- Languages All
Results 1 - 8 of 8 for test_get_items (0.05 sec)
-
tests/test_tutorial/test_python_types/test_tutorial005.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 271 bytes - Viewed (0) -
tests/test_tutorial/test_path_params/test_tutorial001.py
client = TestClient(app) @pytest.mark.parametrize( ("item_id", "expected_response"), [ (1, {"item_id": "1"}), ("alice", {"item_id": "alice"}), ], ) def test_get_items(item_id, expected_response): response = client.get(f"/items/{item_id}") assert response.status_code == 200, response.text assert response.json() == expected_response def test_openapi_schema():
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 3.9K bytes - Viewed (0) -
tests/test_tutorial/test_path_params/test_tutorial002.py
from fastapi.testclient import TestClient from docs_src.path_params.tutorial002_py39 import app client = TestClient(app) def test_get_items(): response = client.get("/items/1") assert response.status_code == 200, response.text assert response.json() == {"item_id": 1} def test_get_items_invalid_id(): response = client.get("/items/item1") assert response.status_code == 422, response.text
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 4.2K bytes - Viewed (0) -
tests/test_tutorial/test_generate_clients/test_tutorial001.py
response = client.post("/items/", json={"name": "Foo", "price": 5}) assert response.status_code == 200, response.text assert response.json() == {"message": "item received"} def test_get_items(client: TestClient): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [ {"name": "Plumbus", "price": 3},
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 5.2K bytes - Viewed (0) -
tests/test_tutorial/test_generate_clients/test_tutorial002.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 Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 7.1K bytes - Viewed (0) -
tests/test_tutorial/test_path_operation_configurations/test_tutorial002.py
"name": "Foo", "description": "Item description", "price": 42.0, "tax": 3.2, "tags": IsList("bar", "baz", check_order=False), } def test_get_items(client: TestClient): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [{"name": "Foo", "price": 42}] def test_get_users(client: TestClient):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 7.6K bytes - Viewed (0) -
tests/test_infer_param_optionality.py
assert response.json() == {"user_id": "abc123"} def test_get_items_1(): """Check that /items returns expected data""" response = client.get("/items") assert response.status_code == 200, response.text assert response.json() == [ {"item_id": "i1", "user_id": "u1"}, {"item_id": "i2", "user_id": "u2"}, ] def test_get_items_2():
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 12.1K bytes - Viewed (0) -
tests/test_tutorial/test_dataclasses/test_tutorial002.py
def get_client(request: pytest.FixtureRequest): mod = importlib.import_module(f"docs_src.dataclasses_.{request.param}") client = TestClient(mod.app) client.headers.clear() return client def test_get_item(client: TestClient): response = client.get("/items/next") assert response.status_code == 200 assert response.json() == { "name": "Island In The Moon", "price": 12.99,
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 2.9K bytes - Viewed (0)