Search Options

Results per page
Sort
Preferred Languages
Advance

Results 681 - 690 of 890 for docs_src (0.11 sec)

  1. docs/em/docs/advanced/testing-dependencies.md

    ๐Ÿ‘ซ ๐Ÿ’ผ, ๐Ÿ‘† **FastAPI** ๐Ÿˆธ โœ”๏ธ ๐Ÿ”ข `app.dependency_overrides`, โšซ๏ธ ๐Ÿ™… `dict`.
    
    ๐Ÿ” ๐Ÿ”— ๐Ÿ”ฌ, ๐Ÿ‘† ๐Ÿšฎ ๐Ÿ”‘ โฎ๏ธ ๐Ÿ”— (๐Ÿ”ข), & ๐Ÿ’ฒ, ๐Ÿ‘† ๐Ÿ”— ๐Ÿ” (โž•1๏ธโƒฃ ๐Ÿ”ข).
    
    & โคด๏ธ **FastAPI** ๐Ÿ”œ ๐Ÿค™ ๐Ÿ‘ˆ ๐Ÿ” โ†ฉ๏ธ โฎ๏ธ ๐Ÿ”—.
    
    ```Python hl_lines="28-29  32"
    {!../../docs_src/dependency_testing/tutorial001.py!}
    ```
    
    /// tip
    
    ๐Ÿ‘† ๐Ÿ’ช โš’ ๐Ÿ”— ๐Ÿ” ๐Ÿ”— โš™๏ธ ๐Ÿ™† ๐Ÿ‘† **FastAPI** ๐Ÿˆธ.
    
    โฎ๏ธ ๐Ÿ”— ๐Ÿ’ช โš™๏ธ *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข*, *โžก ๐Ÿ› ๏ธ ๐Ÿ‘จโ€๐ŸŽจ* (๐Ÿ•โ” ๐Ÿ‘† ๐Ÿšซ โš™๏ธ ๐Ÿ“จ ๐Ÿ’ฒ), `.include_router()` ๐Ÿค™, โ™’๏ธ.
    
    FastAPI ๐Ÿ”œ ๐Ÿ’ช ๐Ÿ” โšซ๏ธ.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_response_model/test_tutorial004_py310.py

    import pytest
    from dirty_equals import IsDict, IsOneOf
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.response_model.tutorial004_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    @pytest.mark.parametrize(
        "url,data",
        [
            ("/items/foo", {"name": "Foo", "price": 50.2}),
            (
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Aug 04 20:47:07 UTC 2023
    - 5.2K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_security/test_tutorial001_an.py

    from fastapi.testclient import TestClient
    
    from docs_src.security.tutorial001_an import app
    
    client = TestClient(app)
    
    
    def test_no_token():
        response = client.get("/items")
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    def test_token():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_testing_dependencies/test_tutorial001.py

    from docs_src.dependency_testing.tutorial001 import (
        app,
        client,
        test_override_in_items,
        test_override_in_items_with_params,
        test_override_in_items_with_q,
    )
    
    
    def test_override_in_items_run():
        test_override_in_items()
    
    
    def test_override_in_items_with_q_run():
        test_override_in_items_with_q()
    
    
    def test_override_in_items_with_params_run():
        test_override_in_items_with_params()
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 10 09:08:19 UTC 2020
    - 1.5K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_testing_dependencies/test_tutorial001_an.py

    from docs_src.dependency_testing.tutorial001_an import (
        app,
        client,
        test_override_in_items,
        test_override_in_items_with_params,
        test_override_in_items_with_q,
    )
    
    
    def test_override_in_items_run():
        test_override_in_items()
    
    
    def test_override_in_items_with_q_run():
        test_override_in_items_with_q()
    
    
    def test_override_in_items_with_params_run():
        test_override_in_items_with_params()
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  6. docs/ja/docs/advanced/response-directly.md

    ไพ‹ใˆใฐใ€Pydanticใƒขใƒ‡ใƒซใ‚’ `JSONResponse` ใซๅซใ‚ใ‚‹ใซใฏใ€ใ™ในใฆใฎใƒ‡ใƒผใ‚ฟๅž‹ (`datetime` ใ‚„ `UUID` ใชใฉ) ใ‚’JSONไบ’ๆ›ใฎๅž‹ใซๅค‰ๆ›ใ•ใ‚ŒใŸ `dict` ใซๅค‰ๆ›ใ—ใชใ‘ใ‚Œใฐใชใ‚Šใพใ›ใ‚“ใ€‚
    
    ใ“ใฎใ‚ˆใ†ใชใ‚ฑใƒผใ‚นใงใฏใ€ใƒฌใ‚นใƒใƒณใ‚นใซใƒ‡ใƒผใ‚ฟใ‚’ๅซใ‚ใ‚‹ๅ‰ใซ `jsonable_encoder` ใ‚’ไฝฟใฃใฆใƒ‡ใƒผใ‚ฟใ‚’ๅค‰ๆ›ใงใใพใ™ใ€‚
    
    ```Python hl_lines="6-7  21-22"
    {!../../docs_src/response_directly/tutorial001.py!}
    ```
    
    /// note | "ๆŠ€่ก“่ฉณ็ดฐ"
    
    ใพใŸใ€`from starlette.responses import JSONResponse` ใ‚‚ๅˆฉ็”จใงใใพใ™ใ€‚
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  7. docs/pt/docs/tutorial/debugging.md

    Vocรช pode conectar o depurador no seu editor, por exemplo, com o Visual Studio Code ou PyCharm.
    
    ## Chamar `uvicorn`
    
    Em seu aplicativo FastAPI, importe e execute `uvicorn` diretamente:
    
    ```Python hl_lines="1  15"
    {!../../docs_src/debugging/tutorial001.py!}
    ```
    
    ### Sobre `__name__ == "__main__"`
    
    O objetivo principal de `__name__ == "__main__"` รฉ ter algum cรณdigo que seja executado quando seu arquivo for chamado com:
    
    <div class="termy">
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  8. docs/ko/docs/tutorial/encoder.md

    ๊ฐ™์€ ๋ฐฉ์‹์œผ๋กœ ์ด ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋Š” Pydantic ๋ชจ๋ธ(์†์„ฑ์ด ์žˆ๋Š” ๊ฐ์ฒด)์„ ๋ฐ›์ง€ ์•Š๊ณ , `dict` ๋งŒ์„ ๋ฐ›์Šต๋‹ˆ๋‹ค.
    
    ์ด๋ฅผ ์œ„ํ•ด `jsonable_encoder` ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    
    Pydantic ๋ชจ๋ธ๊ณผ ๊ฐ™์€ ๊ฐ์ฒด๋ฅผ ๋ฐ›๊ณ  JSON ํ˜ธํ™˜ ๊ฐ€๋Šฅํ•œ ๋ฒ„์ „์œผ๋กœ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค:
    
    ```Python hl_lines="5  22"
    {!../../docs_src/encoder/tutorial001.py!}
    ```
    
    ์ด ์˜ˆ์‹œ๋Š” Pydantic ๋ชจ๋ธ์„ `dict`๋กœ, `datetime` ํ˜•์‹์„ `str`๋กœ ๋ณ€ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_dependencies/test_tutorial001_an_py310.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.dependencies.tutorial001_an_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    @pytest.mark.parametrize(
        "path,expected_status,expected_response",
        [
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 7.2K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_header_params/test_tutorial001_an.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from docs_src.header_params.tutorial001_an import app
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "path,headers,expected_status,expected_response",
        [
            ("/items", None, 200, {"User-Agent": "testclient"}),
            ("/items", {"X-Header": "notvalid"}, 200, {"User-Agent": "testclient"}),
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 3.8K bytes
    - Viewed (0)
Back to top