Search Options

Results per page
Sort
Preferred Languages
Advance

Results 311 - 320 of 550 for tutorial009b_py39 (0.09 sec)

  1. tests/test_tutorial/test_dependencies/test_tutorial008b.py

    import importlib
    
    import pytest
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(
        name="client",
        params=[
            pytest.param("tutorial008b_py39"),
            pytest.param("tutorial008b_an_py39"),
        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.dependencies.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1K bytes
    - Viewed (0)
  2. 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)
  3. docs/de/docs/advanced/websockets.md

    {* ../../docs_src/websockets/tutorial001_py39.py hl[2,6:38,41:43] *}
    
    ## Einen `websocket` erstellen { #create-a-websocket }
    
    Erstellen Sie in Ihrer **FastAPI**-Anwendung einen `websocket`:
    
    {* ../../docs_src/websockets/tutorial001_py39.py hl[1,46:47] *}
    
    /// note | Technische Details
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 6.5K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_custom_response/test_tutorial006c.py

    from fastapi.testclient import TestClient
    
    from docs_src.custom_response.tutorial006c_py39 import app
    
    client = TestClient(app)
    
    
    def test_redirect_status_code():
        response = client.get("/pydantic", follow_redirects=False)
        assert response.status_code == 302
        assert response.headers["location"] == "https://docs.pydantic.dev/"
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 904 bytes
    - Viewed (0)
  5. docs/de/docs/advanced/behind-a-proxy.md

    In diesem Fall würde der ursprüngliche Pfad `/app` tatsächlich unter `/api/v1/app` bereitgestellt.
    
    Auch wenn Ihr gesamter Code unter der Annahme geschrieben ist, dass es nur `/app` gibt.
    
    {* ../../docs_src/behind_a_proxy/tutorial001_py39.py hl[6] *}
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 18.6K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_body_nested_models/test_tutorial009.py

    import importlib
    
    import pytest
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(
        name="client",
        params=[
            "tutorial009_py39",
        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.body_nested_models.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    def test_post_body(client: TestClient):
        data = {"2": 2.2, "3": 3.3}
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 4K bytes
    - Viewed (0)
  7. docs/en/docs/advanced/testing-websockets.md

    # Testing WebSockets { #testing-websockets }
    
    You can use the same `TestClient` to test WebSockets.
    
    For this, you use the `TestClient` in a `with` statement, connecting to the WebSocket:
    
    {* ../../docs_src/app_testing/tutorial002_py39.py hl[27:31] *}
    
    /// note
    
    For more details, check Starlette's documentation for <a href="https://www.starlette.dev/testclient/#testing-websocket-sessions" class="external-link" target="_blank">testing WebSockets</a>.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 459 bytes
    - Viewed (0)
  8. tests/test_tutorial/test_testing/test_tutorial004.py

    from docs_src.app_testing.tutorial004_py39 import test_read_items
    
    
    def test_main():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 107 bytes
    - Viewed (0)
  9. docs/en/docs/advanced/websockets.md

    But it's the simplest way to focus on the server-side of WebSockets and have a working example:
    
    {* ../../docs_src/websockets/tutorial001_py39.py hl[2,6:38,41:43] *}
    
    ## Create a `websocket` { #create-a-websocket }
    
    In your **FastAPI** application, create a `websocket`:
    
    {* ../../docs_src/websockets/tutorial001_py39.py hl[1,46:47] *}
    
    /// note | Technical Details
    
    You could also use `from starlette.websockets import WebSocket`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 5.7K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_advanced_middleware/test_tutorial002.py

    from fastapi.testclient import TestClient
    
    from docs_src.advanced_middleware.tutorial002_py39 import app
    
    
    def test_middleware():
        client = TestClient(app, base_url="http://example.com")
        response = client.get("/")
        assert response.status_code == 200, response.text
        client = TestClient(app, base_url="http://subdomain.example.com")
        response = client.get("/")
        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
    - 575 bytes
    - Viewed (0)
Back to top