Search Options

Results per page
Sort
Preferred Languages
Advance

Results 671 - 680 of 924 for docs_src (0.03 sec)

  1. tests/test_tutorial/test_custom_response/test_tutorial006b.py

    from fastapi.testclient import TestClient
    
    from docs_src.custom_response.tutorial006b_py39 import app
    
    client = TestClient(app)
    
    
    def test_redirect_response_class():
        response = client.get("/fastapi", follow_redirects=False)
        assert response.status_code == 307
        assert response.headers["location"] == "https://fastapi.tiangolo.com"
    
    
    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)
  2. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial001.py

    from fastapi.testclient import TestClient
    
    from docs_src.path_operation_advanced_configuration.tutorial001_py39 import app
    
    client = TestClient(app)
    
    
    def test_get():
        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)
  3. docs/uk/docs/tutorial/static-files.md

    ## Використання `StaticFiles`
    
    * Імпортуйте `StaticFiles`.
    * "Під'єднати" екземпляр `StaticFiles()` з вказанням необхідного шляху.
    
    {* ../../docs_src/static_files/tutorial001.py hl[2,6] *}
    
    /// note | Технічні деталі
    
    Ви також можете використовувати `from starlette.staticfiles import StaticFiles`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 2.6K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_dependencies/test_tutorial011.py

    @pytest.fixture(
        name="client",
        params=[
            "tutorial011_py39",
            pytest.param("tutorial011_an_py39"),
        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.dependencies.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    @pytest.mark.parametrize(
        "path,expected_status,expected_response",
        [
            (
                "/query-checker/",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 3.9K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_response_model/test_tutorial003_05.py

        params=[
            pytest.param("tutorial003_05_py39"),
            pytest.param("tutorial003_05_py310", marks=needs_py310),
        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.response_model.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    def test_get_portal(client: TestClient):
        response = client.get("/portal")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 3.8K bytes
    - Viewed (0)
  6. docs/es/docs/advanced/wsgi.md

    ## Usando `WSGIMiddleware` { #using-wsgimiddleware }
    
    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)
  7. tests/test_tutorial/test_handling_errors/test_tutorial003.py

    from fastapi.testclient import TestClient
    
    from docs_src.handling_errors.tutorial003_py39 import app
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/unicorns/shinny")
        assert response.status_code == 200, response.text
        assert response.json() == {"unicorn_name": "shinny"}
    
    
    def test_get_exception():
        response = client.get("/unicorns/yolo")
        assert response.status_code == 418, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 3.2K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_security/test_tutorial001.py

    @pytest.fixture(
        name="client",
        params=[
            pytest.param("tutorial001_py39"),
            pytest.param("tutorial001_an_py39"),
        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.security.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    def test_no_token(client: TestClient):
        response = client.get("/items")
        assert response.status_code == 401, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 2.2K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_body_nested_models/test_tutorial009.py

    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)
  10. tests/test_tutorial/test_cookie_params/test_tutorial001.py

            "tutorial001_an_py39",
            pytest.param("tutorial001_an_py310", marks=needs_py310),
        ],
    )
    def get_mod(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.cookie_params.{request.param}")
    
        return mod
    
    
    @pytest.mark.parametrize(
        "path,cookies,expected_status,expected_response",
        [
            ("/items", None, 200, {"ads_id": None}),
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 4K bytes
    - Viewed (0)
Back to top