- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 14 for test_read_items (0.07 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
tests/test_tutorial/test_testing/test_tutorial003.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 172 bytes - Click Count (0) -
tests/test_tutorial/test_testing/test_tutorial004.py
from docs_src.app_testing.tutorial004_py39 import test_read_items def test_main():
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 107 bytes - Click Count (0) -
tests/test_tutorial/test_response_model/test_tutorial001_tutorial001_01.py
], ) def get_client(request: pytest.FixtureRequest): mod = importlib.import_module(f"docs_src.response_model.{request.param}") client = TestClient(mod.app) return client def test_read_items(client: TestClient): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [ { "name": "Portal Gun",
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 6.5K bytes - Click Count (0) -
tests/test_tutorial/test_path_params_numeric_validations/test_tutorial005.py
@pytest.mark.parametrize( "path,expected_response", [ ("/items/1?q=", {"item_id": 1}), ("/items/1000?q=somequery", {"item_id": 1000, "q": "somequery"}), ], ) def test_read_items(client: TestClient, path, expected_response): response = client.get(path) assert response.status_code == 200, response.text assert response.json() == expected_response
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 6.6K bytes - Click Count (0) -
docs_src/app_testing/tutorial004_py39.py
yield # clean up items items.clear() app = FastAPI(lifespan=lifespan) @app.get("/items/{item_id}") async def read_items(item_id: str): return items[item_id] def test_read_items(): # Before the lifespan starts, "items" is still empty assert items == {} with TestClient(app) as client: # Inside the "with TestClient" block, the lifespan starts and items addedCreated: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 1.2K bytes - Click Count (0) -
tests/test_tutorial/test_path_params_numeric_validations/test_tutorial001.py
@pytest.mark.parametrize( "path,expected_response", [ ("/items/42", {"item_id": 42}), ("/items/123?item-query=somequery", {"item_id": 123, "q": "somequery"}), ], ) def test_read_items(client: TestClient, path, expected_response): response = client.get(path) assert response.status_code == 200, response.text assert response.json() == expected_response
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 5.6K bytes - Click Count (0) -
tests/test_tutorial/test_separate_openapi_schemas/test_tutorial001.py
response = client.post("/items/", json={"name": "Foo"}) assert response.status_code == 200, response.text assert response.json() == {"name": "Foo", "description": None} def test_read_items(client: TestClient) -> None: response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [ { "name": "Portal Gun",
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 20 15:55:38 GMT 2025 - 5K bytes - Click Count (0) -
tests/test_tutorial/test_path_params_numeric_validations/test_tutorial002_tutorial003.py
@pytest.mark.parametrize( "path,expected_response", [ ("/items/42?q=", {"item_id": 42}), ("/items/123?q=somequery", {"item_id": 123, "q": "somequery"}), ], ) def test_read_items(client: TestClient, path, expected_response): response = client.get(path) assert response.status_code == 200, response.text assert response.json() == expected_response
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 5.6K bytes - Click Count (0) -
tests/test_tutorial/test_path_params_numeric_validations/test_tutorial004.py
@pytest.mark.parametrize( "path,expected_response", [ ("/items/42?q=", {"item_id": 42}), ("/items/1?q=somequery", {"item_id": 1, "q": "somequery"}), ], ) def test_read_items(client: TestClient, path, expected_response): response = client.get(path) assert response.status_code == 200, response.text assert response.json() == expected_response
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 6K bytes - Click Count (0) -
tests/test_tutorial/test_security/test_tutorial004.py
"/users/me", headers={"Authorization": f"Bearer {access_token}"} ) assert response.status_code == 400, response.text assert response.json() == {"detail": "Inactive user"} def test_read_items(mod: ModuleType): client = TestClient(mod.app) access_token = get_access_token(client=client) response = client.get( "/users/me/items/", headers={"Authorization": f"Bearer {access_token}"} )Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 13.3K bytes - Click Count (0)