Search Options

Results per page
Sort
Preferred Languages
Advance

Results 301 - 310 of 550 for tutorial008e_py39 (0.07 sec)

  1. tests/test_tutorial/test_response_cookies/test_tutorial002.py

    from fastapi.testclient import TestClient
    
    from docs_src.response_cookies.tutorial002_py39 import app
    
    client = TestClient(app)
    
    
    def test_path_operation():
        response = client.post("/cookie-and-object/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Come to the dark side, we have cookies"}
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 419 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_testing/test_tutorial001.py

    from docs_src.app_testing.tutorial001_py39 import client, test_read_main
    
    
    def test_main():
        test_read_main()
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/": {
                    "get": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 826 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_wsgi/test_tutorial001.py

    from fastapi.testclient import TestClient
    
    from docs_src.wsgi.tutorial001_py39 import app
    
    client = TestClient(app)
    
    
    def test_flask():
        response = client.get("/v1/")
        assert response.status_code == 200, response.text
        assert response.text == "Hello, World from Flask!"
    
    
    def test_app():
        response = client.get("/v2")
        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
    - 441 bytes
    - Viewed (1)
  4. docs/ru/docs/advanced/websockets.md

    {* ../../docs_src/websockets/tutorial001_py39.py hl[2,6:38,41:43] *}
    
    ## Создание `websocket` { #create-a-websocket }
    
    Создайте `websocket` в своем **FastAPI** приложении:
    
    {* ../../docs_src/websockets/tutorial001_py39.py hl[1,46:47] *}
    
    /// note | Технические детали
    
    Вы также можете использовать `from starlette.websockets import WebSocket`.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 8.6K bytes
    - Viewed (0)
  5. docs/ru/docs/tutorial/first-steps.md

    {* ../../docs_src/first_steps/tutorial001_py39.py hl[7] *}
    
    Это функция на Python.
    
    **FastAPI** будет вызывать её каждый раз, когда получает запрос к URL «`/`» с операцией `GET`.
    
    В данном случае это асинхронная (`async`) функция.
    
    ---
    
    Вы также можете определить её как обычную функцию вместо `async def`:
    
    {* ../../docs_src/first_steps/tutorial003_py39.py hl[7] *}
    
    /// note | Примечание
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 17.7K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_custom_response/test_tutorial001b.py

    from fastapi.testclient import TestClient
    
    from docs_src.custom_response.tutorial001b_py39 import app
    
    client = TestClient(app)
    
    
    def test_get_custom_response():
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [{"item_id": "Foo"}]
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        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)
  7. tests/test_tutorial/test_dependencies/test_tutorial008.py

    from unittest.mock import Mock, patch
    
    import pytest
    from fastapi import Depends, FastAPI
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(
        name="module",
        params=[
            "tutorial008_py39",
            # Fails with `NameError: name 'DepA' is not defined`
            pytest.param("tutorial008_an_py39", marks=pytest.mark.xfail),
        ],
    )
    def get_module(request: pytest.FixtureRequest):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 1.4K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. 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)
Back to top