- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 16 for test_get_item_1 (0.12 sec)
-
tests/test_infer_param_optionality.py
assert response.json() == [{"item_id": "i2", "user_id": "abc123"}] def test_get_item_1(): """Check that /items/{item_id} returns expected data""" response = client.get("/items/item01") assert response.status_code == 200, response.text assert response.json() == {"item_id": "item01"} def test_get_item_2(): """Check that /items/{item_id} returns expected data with user_id specified"""
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_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_extra_models/test_tutorial005.py
], ) def get_client(request: pytest.FixtureRequest): mod = importlib.import_module(f"docs_src.extra_models.{request.param}") client = TestClient(mod.app) return client def test_get_items(client: TestClient): response = client.get("/keyword-weights/") assert response.status_code == 200, response.text assert response.json() == {"foo": 2.3, "bar": 3.4}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 1.7K 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_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) -
tests/test_tutorial/test_path_operation_configurations/test_tutorial002b.py
from fastapi.testclient import TestClient from docs_src.path_operation_configuration.tutorial002b_py39 import app client = TestClient(app) def test_get_items(): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == ["Portal gun", "Plumbus"] def test_get_users(): response = client.get("/users/") assert response.status_code == 200, response.text
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 1.7K 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_dependencies/test_tutorial008b.py
def test_owner_error(client: TestClient): response = client.get("/items/plumbus") assert response.status_code == 400, response.text assert response.json() == {"detail": "Owner error: Rick"} def test_get_item(client: TestClient): response = client.get("/items/portal-gun") assert response.status_code == 200, response.text
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 1K bytes - Viewed (0) -
tests/test_tutorial/test_extra_models/test_tutorial004.py
], ) def get_client(request: pytest.FixtureRequest): mod = importlib.import_module(f"docs_src.extra_models.{request.param}") client = TestClient(mod.app) return client def test_get_items(client: TestClient): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [ {"name": "Foo", "description": "There comes my hero"},
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 2.2K bytes - Viewed (0)