Search Options

Results per page
Sort
Preferred Languages
Advance

Results 461 - 470 of 616 for tutorial012_py39 (0.07 sec)

  1. tests/test_tutorial/test_path_operation_configurations/test_tutorial006.py

    import pytest
    from fastapi.testclient import TestClient
    
    from docs_src.path_operation_configuration.tutorial006_py39 import app
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "path,expected_status,expected_response",
        [
            ("/items/", 200, [{"name": "Foo", "price": 42}]),
            ("/users/", 200, [{"username": "johndoe"}]),
            ("/elements/", 200, [{"item_id": "Foo"}]),
        ],
    )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 2.4K bytes
    - Viewed (0)
  2. docs/de/docs/advanced/wsgi.md

    Sie müssen `WSGIMiddleware` importieren.
    
    Wrappen Sie dann die WSGI-Anwendung (z. B. Flask) mit der Middleware.
    
    Und dann mounten Sie das auf einem Pfad.
    
    {* ../../docs_src/wsgi/tutorial001_py39.py hl[2:3,3] *}
    
    ## Es testen { #check-it }
    
    Jetzt wird jeder <abbr title="Request – Anfrage: Daten, die der Client zum Server sendet">Request</abbr> unter dem Pfad `/v1/` von der Flask-Anwendung verarbeitet.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1.4K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_handling_errors/test_tutorial006.py

    from fastapi.testclient import TestClient
    
    from docs_src.handling_errors.tutorial006_py39 import app
    
    client = TestClient(app)
    
    
    def test_get_validation_error():
        response = client.get("/items/foo")
        assert response.status_code == 422, response.text
        assert response.json() == {
            "detail": [
                {
                    "type": "int_parsing",
                    "loc": ["path", "item_id"],
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 3.6K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_path_params/test_tutorial003.py

    import pytest
    from fastapi.testclient import TestClient
    
    from docs_src.path_params.tutorial003_py39 import app
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        ("user_id", "expected_response"),
        [
            ("me", {"user_id": "the current user"}),
            ("alice", {"user_id": "alice"}),
        ],
    )
    def test_get_users(user_id: str, expected_response: dict):
        response = client.get(f"/users/{user_id}")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 4.6K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_graphql/test_tutorial001.py

    from starlette.testclient import TestClient
    
    warnings.filterwarnings(
        "ignore",
        message=r"The 'lia' package has been renamed to 'cross_web'\..*",
        category=DeprecationWarning,
    )
    
    from docs_src.graphql_.tutorial001_py39 import app  # noqa: E402
    
    
    @pytest.fixture(name="client")
    def get_client() -> TestClient:
        return TestClient(app)
    
    
    def test_query(client: TestClient):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 2.2K bytes
    - Viewed (0)
  6. docs/ru/docs/advanced/response-directly.md

    Вы можете поместить ваш XML-контент в строку, поместить её в `Response` и вернуть:
    
    {* ../../docs_src/response_directly/tutorial002_py39.py hl[1,18] *}
    
    ## Примечания { #notes }
    
    Когда вы возвращаете объект `Response` напрямую, его данные не валидируются, не преобразуются (не сериализуются) и не документируются автоматически.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_generate_clients/test_tutorial001.py

    import importlib
    
    import pytest
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(
        name="client",
        params=[
            pytest.param("tutorial001_py39"),
        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.generate_clients.{request.param}")
        client = TestClient(mod.app)
        return client
    
    
    def test_post_items(client: TestClient):
    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_extra_models/test_tutorial004.py

    import importlib
    
    import pytest
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(
        name="client",
        params=[
            pytest.param("tutorial004_py39"),
        ],
    )
    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):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 2.2K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/middleware.md

        * Then it returns the `response` generated by the corresponding *path operation*.
    * You can then further modify the `response` before returning it.
    
    {* ../../docs_src/middleware/tutorial001_py39.py hl[8:9,11,14] *}
    
    /// tip
    
    Keep in mind that custom proprietary headers can be added <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers" class="external-link" target="_blank">using the `X-` prefix</a>.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 4.1K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_query_params/test_tutorial001.py

    import importlib
    
    import pytest
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(
        name="client",
        params=[
            pytest.param("tutorial001_py39"),
        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.query_params.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    @pytest.mark.parametrize(
        ("path", "expected_json"),
        [
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 4.1K bytes
    - Viewed (0)
Back to top