Search Options

Results per page
Sort
Preferred Languages
Advance

Results 651 - 660 of 924 for docs_src (0.04 sec)

  1. tests/test_tutorial/test_handling_errors/test_tutorial004.py

    from fastapi.testclient import TestClient
    
    from docs_src.handling_errors.tutorial004_py39 import app
    
    client = TestClient(app)
    
    
    def test_get_validation_error():
        response = client.get("/items/foo")
        assert response.status_code == 400, response.text
        assert "Validation errors:" in response.text
        assert "Field: ('path', 'item_id')" in response.text
    
    
    def test_get_http_error():
        response = client.get("/items/3")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 3.4K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_settings/test_app01.py

    from pytest import MonkeyPatch
    
    
    @pytest.fixture(
        name="mod_name",
        params=[
            pytest.param("app01_py39"),
        ],
    )
    def get_mod_name(request: pytest.FixtureRequest):
        return f"docs_src.settings.{request.param}.main"
    
    
    @pytest.fixture(name="client")
    def get_test_client(mod_name: str, monkeypatch: MonkeyPatch) -> TestClient:
        if mod_name in sys.modules:
            del sys.modules[mod_name]
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 2.2K bytes
    - Viewed (0)
  3. docs/ru/docs/advanced/testing-websockets.md

    # Тестирование WebSocket { #testing-websockets }
    
    Вы можете использовать тот же `TestClient` для тестирования WebSocket.
    
    Для этого используйте `TestClient` с менеджером контекста `with`, подключаясь к WebSocket:
    
    {* ../../docs_src/app_testing/tutorial002_py39.py hl[27:31] *}
    
    /// note | Примечание
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 655 bytes
    - Viewed (0)
  4. tests/test_tutorial/test_behind_a_proxy/test_tutorial001_01.py

    from fastapi.testclient import TestClient
    
    from docs_src.behind_a_proxy.tutorial001_01_py39 import app
    
    client = TestClient(
        app,
        base_url="https://example.com",
        follow_redirects=False,
    )
    
    
    def test_redirect() -> None:
        response = client.get("/items")
        assert response.status_code == 307
        assert response.headers["location"] == "https://example.com/items/"
    
    
    def test_no_redirect() -> None:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 544 bytes
    - Viewed (0)
  5. docs/es/docs/tutorial/dependencies/global-dependencies.md

    En ese caso, se aplicarán a todas las *path operations* en la aplicación:
    
    {* ../../docs_src/dependencies/tutorial012_an_py39.py hl[17] *}
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1.2K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_custom_docs_ui/test_tutorial001.py

    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(scope="module")
    def client():
        static_dir: Path = Path(os.getcwd()) / "static"
        print(static_dir)
        static_dir.mkdir(exist_ok=True)
        from docs_src.custom_docs_ui.tutorial001_py39 import app
    
        with TestClient(app) as client:
            yield client
        static_dir.rmdir()
    
    
    def test_swagger_ui_html(client: TestClient):
        response = client.get("/docs")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  7. docs/pt/docs/tutorial/security/first-steps.md

    Vamos primeiro usar o código e ver como funciona, e depois voltaremos para entender o que está acontecendo.
    
    ## Crie um `main.py` { #create-main-py }
    
    Copie o exemplo em um arquivo `main.py`:
    
    {* ../../docs_src/security/tutorial001_an_py39.py *}
    
    ## Execute-o { #run-it }
    
    /// info | Informação
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Nov 12 16:23:57 UTC 2025
    - 8.9K bytes
    - Viewed (0)
  8. docs/es/docs/tutorial/security/first-steps.md

    Primero solo usemos el código y veamos cómo funciona, y luego volveremos para entender qué está sucediendo.
    
    ## Crea `main.py` { #create-main-py }
    
    Copia el ejemplo en un archivo `main.py`:
    
    {* ../../docs_src/security/tutorial001_an_py39.py *}
    
    ## Ejecútalo { #run-it }
    
    /// info | Información
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 16:33:45 UTC 2025
    - 8.9K bytes
    - Viewed (0)
  9. docs/en/docs/advanced/openapi-callbacks.md

    This part is pretty normal, most of the code is probably already familiar to you:
    
    {* ../../docs_src/openapi_callbacks/tutorial001_py310.py hl[7:11,34:51] *}
    
    /// tip
    
    The `callback_url` query parameter uses a Pydantic <a href="https://docs.pydantic.dev/latest/api/networks/" class="external-link" target="_blank">Url</a> type.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 10 08:55:32 UTC 2025
    - 8K bytes
    - Viewed (0)
  10. docs/pt/docs/advanced/openapi-callbacks.md

    Essa parte é bastante normal, a maior parte do código provavelmente já é familiar para você:
    
    {* ../../docs_src/openapi_callbacks/tutorial001_py310.py hl[7:11,34:51] *}
    
    /// tip | Dica
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 20:32:40 UTC 2025
    - 8.4K bytes
    - Viewed (0)
Back to top