- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 2,056 for app (0.02 sec)
-
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) -
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) -
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) -
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) -
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) -
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) -
docs/em/docs/advanced/behind-a-proxy.md
& โซ๏ธ โ๏ธ ๐ ๐โ ๐ ๐ง-๐ธ. ## ๐ณ โฎ๏ธ ๐ โก ๐ก โ๏ธ ๐ณ โฎ๏ธ ๐ โก ๐ก, ๐ ๐ผ, โ ๐ ๐ ๐ช ๐ฃ โก `/app` ๐ ๐, โ๏ธ โคด๏ธ, ๐ ๐ฎ ๐งฝ ๐ ๐ (๐ณ) ๐ ๐ ๐ฎ ๐ **FastAPI** ๐ธ ๐ฝ โก ๐ `/api/v1`. ๐ ๐ผ, โฎ๏ธ โก `/app` ๐ ๐ค ๐ฆ `/api/v1/app`. โ๏ธ ๐ ๐ ๐ โ ๐ค ๐ค `/app`. & ๐ณ ๐ **"โ"** **โก ๐ก** ๐ โ โญ ๐ถ ๐จ 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) -
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) -
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) -
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)