Search Options

Results per page
Sort
Preferred Languages
Advance

Results 461 - 470 of 641 for tutorial006_py39 (0.06 sec)

  1. tests/test_tutorial/test_events/test_tutorial002.py

    import pytest
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="app", scope="module")
    def get_app():
        with pytest.warns(DeprecationWarning):
            from docs_src.events.tutorial002_py39 import app
        yield app
    
    
    def test_events(app: FastAPI):
        with TestClient(app) as client:
            response = client.get("/items/")
            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.4K bytes
    - Viewed (0)
  2. docs/ru/docs/tutorial/dependencies/dependencies-with-yield.md

    {* ../../docs_src/dependencies/tutorial007_py39.py hl[2:4] *}
    
    Значение, полученное из `yield`, внедряется в *операции пути* и другие зависимости:
    
    {* ../../docs_src/dependencies/tutorial007_py39.py hl[4] *}
    
    Код, следующий за оператором `yield`, выполняется после ответа:
    
    {* ../../docs_src/dependencies/tutorial007_py39.py hl[5:6] *}
    
    /// tip | Подсказка
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 19.7K bytes
    - Viewed (0)
  3. docs/es/docs/advanced/response-change-status-code.md

    Y luego puedes establecer el `status_code` en ese objeto de response *temporal*.
    
    {* ../../docs_src/response_change_status_code/tutorial001_py39.py hl[1,9,12] *}
    
    Y luego puedes devolver cualquier objeto que necesites, como lo harías normalmente (un `dict`, un modelo de base de datos, etc.).
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1.7K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_header_params/test_tutorial003.py

    import importlib
    
    import pytest
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(
        name="client",
        params=[
            pytest.param("tutorial003_py39"),
            pytest.param("tutorial003_py310", marks=needs_py310),
            pytest.param("tutorial003_an_py39"),
            pytest.param("tutorial003_an_py310", marks=needs_py310),
        ],
    )
    def get_client(request: pytest.FixtureRequest):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 4.1K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_openapi_webhooks/test_tutorial001.py

    from fastapi.testclient import TestClient
    
    from docs_src.openapi_webhooks.tutorial001_py39 import app
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/users/")
        assert response.status_code == 200, response.text
        assert response.json() == ["Rick", "Morty"]
    
    
    def test_dummy_webhook():
        # Just for coverage
        app.webhooks.routes[0].endpoint({})
    
    
    def test_openapi_schema():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 4.4K bytes
    - Viewed (0)
  6. docs/pt/docs/advanced/wsgi.md

    Você precisa importar o `WSGIMiddleware`.
    
    Em seguida, encapsule a aplicação WSGI (e.g. Flask) com o middleware.
    
    E então monte isso sob um path.
    
    {* ../../docs_src/wsgi/tutorial001_py39.py hl[2:3,3] *}
    
    ## Confira { #check-it }
    
    Agora, todas as requisições sob o path `/v1/` serão manipuladas pela aplicação Flask.
    
    E o resto será manipulado pelo **FastAPI**.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1.2K bytes
    - Viewed (0)
  7. 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)
  8. docs/de/docs/tutorial/middleware.md

        * Dann gibt es die von der entsprechenden *Pfadoperation* generierte `response` zurück.
    * Sie können die `response` dann weiter modifizieren, bevor Sie sie zurückgeben.
    
    {* ../../docs_src/middleware/tutorial001_py39.py hl[8:9,11,14] *}
    
    /// tip | Tipp
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 4.9K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_static_files/test_tutorial001.py

        static_dir: Path = Path(os.getcwd()) / "static"
        static_dir.mkdir(exist_ok=True)
        sample_file = static_dir / "sample.txt"
        sample_file.write_text("This is a sample static file.")
        from docs_src.static_files.tutorial001_py39 import app
    
        with TestClient(app) as client:
            yield client
        sample_file.unlink()
        static_dir.rmdir()
    
    
    def test_static_files(client: TestClient):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 1.1K bytes
    - Viewed (0)
  10. docs/es/docs/advanced/wsgi.md

    Necesitas importar `WSGIMiddleware`.
    
    Luego envuelve la aplicación WSGI (p. ej., Flask) con el middleware.
    
    Y luego móntala bajo un path.
    
    {* ../../docs_src/wsgi/tutorial001_py39.py hl[2:3,3] *}
    
    ## Revisa { #check-it }
    
    Ahora, cada request bajo el path `/v1/` será manejado por la aplicación Flask.
    
    Y el resto será manejado por **FastAPI**.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1.2K bytes
    - Viewed (0)
Back to top