Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for test_get_item_2 (0.07 sec)

  1. tests/test_tutorial/test_python_types/test_tutorial005.py

    from docs_src.python_types.tutorial005_py39 import get_items
    
    
    def test_get_items():
        res = get_items(
            "item_a",
            "item_b",
            "item_c",
            "item_d",
            "item_e",
        )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 271 bytes
    - Viewed (0)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top