Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 2,056 for app (0.02 sec)

  1. tests/test_router_events.py

        async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
            yield
    
        @asynccontextmanager
        async def router_lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
            yield
    
        router = APIRouter(lifespan=router_lifespan)
        app = FastAPI(lifespan=lifespan)
        app.include_router(router)
    
        with TestClient(app) as client:
            assert not client.app_state
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 24 19:09:52 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  2. tests/test_multipart_installation.py

            warnings.simplefilter("always")
            monkeypatch.delattr("multipart.multipart.parse_options_header", raising=False)
        with pytest.raises(RuntimeError, match=multipart_incorrect_install_error):
            app = FastAPI()
    
            @app.post("/")
            async def root(username: str = Form()):
                return username  # pragma: nocover
    
    
    def test_incorrect_multipart_installed_file_upload(monkeypatch):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 21:46:26 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  3. tests/test_ws_router.py

        raise CustomError()
    
    
    def make_app(app=None, **kwargs):
        app = app or FastAPI(**kwargs)
        app.include_router(router)
        app.include_router(prefix_router, prefix="/prefix")
        app.include_router(native_prefix_route)
        return app
    
    
    app = make_app(app)
    
    
    def test_app():
        client = TestClient(app)
        with client.websocket_connect("/") as websocket:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Jun 11 19:08:14 UTC 2023
    - 7.5K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_websockets/test_tutorial002_an_py39.py

    from fastapi.websockets import WebSocketDisconnect
    
    from ...utils import needs_py39
    
    
    @pytest.fixture(name="app")
    def get_app():
        from docs_src.websockets.tutorial002_an_py39 import app
    
        return app
    
    
    @needs_py39
    def test_main(app: FastAPI):
        client = TestClient(app)
        response = client.get("/")
        assert response.status_code == 200, response.text
        assert b"<!DOCTYPE html>" in response.content
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  5. tests/test_ws_dependencies.py

    
    def test_routerindex():
        client = TestClient(app)
        with client.websocket_connect("/router") as websocket:
            data = json.loads(websocket.receive_text())
            assert data == ["app", "router2", "router", "routerindex"]
    
    
    def test_routerprefixindex():
        client = TestClient(app)
        with client.websocket_connect("/prefix/") as websocket:
            data = json.loads(websocket.receive_text())
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Jun 11 20:35:39 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  6. tests/test_dependency_contextmanager.py

            yield state
        finally:
            state["context_b"] = f"finished b with a: {state['context_a']}"
    
    
    @app.get("/async")
    async def get_async(state: str = Depends(asyncgen_state)):
        return state
    
    
    @app.get("/sync")
    async def get_sync(state: str = Depends(generator_state)):
        return state
    
    
    @app.get("/async_raise")
    async def get_async_raise(state: str = Depends(asyncgen_state_try)):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 17 04:13:50 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  7. docs/em/docs/advanced/behind-a-proxy.md

    &amp; โšซ๏ธ โš™๏ธ ๐Ÿ”˜ ๐Ÿ•โ” ๐Ÿ—œ ๐ŸŽง-๐Ÿˆธ.
    
    ## ๐Ÿ—ณ โฎ๏ธ ๐ŸŽž โžก ๐Ÿ”ก
    
    โœ”๏ธ ๐Ÿ—ณ โฎ๏ธ ๐ŸŽž โžก ๐Ÿ”ก, ๐Ÿ‘‰ ๐Ÿ’ผ, โ›“ ๐Ÿ‘ˆ ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ“ฃ โžก `/app` ๐Ÿ‘† ๐Ÿ“Ÿ, โœ‹๏ธ โคด๏ธ, ๐Ÿ‘† ๐Ÿšฎ ๐Ÿงฝ ๐Ÿ”› ๐Ÿ” (๐Ÿ—ณ) ๐Ÿ‘ˆ ๐Ÿ”œ ๐Ÿšฎ ๐Ÿ‘† **FastAPI** ๐Ÿˆธ ๐Ÿ”ฝ โžก ๐Ÿ’– `/api/v1`.
    
    ๐Ÿ‘‰ ๐Ÿ’ผ, โฎ๏ธ โžก `/app` ๐Ÿ”œ ๐Ÿค™ ๐Ÿฆ `/api/v1/app`.
    
    โœ‹๏ธ ๐ŸŒ ๐Ÿ‘† ๐Ÿ“Ÿ โœ ๐Ÿค” ๐Ÿ“ค `/app`.
    
    &amp; ๐Ÿ—ณ ๐Ÿ”œ **"โŽ"** **โžก ๐Ÿ”ก** ๐Ÿ”› โœˆ โญ ๐Ÿ“ถ ๐Ÿ“จ Uvicorn, ๐Ÿšง ๐Ÿ‘† ๐Ÿˆธ ๐Ÿค” ๐Ÿ‘ˆ โšซ๏ธ ๐Ÿฆ `/app`, ๐Ÿ‘ˆ ๐Ÿ‘† ๐Ÿšซ โœ”๏ธ โ„น ๐ŸŒ ๐Ÿ‘† ๐Ÿ“Ÿ ๐Ÿ”Œ ๐Ÿ”ก `/api/v1`.
    
    ๐Ÿ†™ ๐Ÿ“ฅ, ๐ŸŒ ๐Ÿ”œ ๐Ÿ‘ท ๐Ÿ›Ž.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 10.1K bytes
    - Viewed (0)
  8. tests/test_invalid_sequence_param.py

    def test_invalid_sequence():
        with pytest.raises(AssertionError):
            app = FastAPI()
    
            class Item(BaseModel):
                title: str
    
            @app.get("/items/")
            def read_items(q: List[Item] = Query(default=None)):
                pass  # pragma: no cover
    
    
    def test_invalid_tuple():
        with pytest.raises(AssertionError):
            app = FastAPI()
    
            class Item(BaseModel):
                title: str
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri May 13 23:38:22 UTC 2022
    - 1.2K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_request_files/test_tutorial003_an_py39.py

    from fastapi.testclient import TestClient
    
    from ...utils import needs_py39
    
    
    @pytest.fixture(name="app")
    def get_app():
        from docs_src.request_files.tutorial003_an_py39 import app
    
        return app
    
    
    @pytest.fixture(name="client")
    def get_client(app: FastAPI):
        client = TestClient(app)
        return client
    
    
    file_required = {
        "detail": [
            {
                "loc": ["body", "files"],
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  10. tests/test_generate_unique_id_function.py

            return "foo"
    
        app = FastAPI(generate_unique_id_function=broken_operation_id)
    
        @app.post("/")
        def post_root(item1: Item):
            return item1  # pragma: nocover
    
        @app.post("/second")
        def post_second(item1: Item):
            return item1  # pragma: nocover
    
        @app.post("/third")
        def post_third(item1: Item):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Jan 13 15:10:26 UTC 2024
    - 66.7K bytes
    - Viewed (0)
Back to top