- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 820 for defa (0.8 sec)
-
tests/test_dependency_after_yield_websockets.py
class Session: def __init__(self) -> None: self.data = ["foo", "bar", "baz"] self.open = True def __iter__(self) -> Generator[str, None, None]: for item in self.data: if self.open: yield item else: raise ValueError("Session closed") @contextmanager def acquire_session() -> Generator[Session, None, None]:Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 2K bytes - Viewed (0) -
tests/test_tutorial/test_body/test_tutorial001.py
params=[ "tutorial001_py39", pytest.param("tutorial001_py310", marks=needs_py310), ], ) def get_client(request: pytest.FixtureRequest): mod = importlib.import_module(f"docs_src.body.{request.param}") client = TestClient(mod.app) return client def test_body_float(client: TestClient): response = client.post("/items/", json={"name": "Foo", "price": 50.5})Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 10.6K bytes - Viewed (0) -
fastapi/datastructures.py
""" def __init__(self, value: Any): self.value = value def __bool__(self) -> bool: return bool(self.value) def __eq__(self, o: object) -> bool: return isinstance(o, DefaultPlaceholder) and o.value == self.value DefaultType = TypeVar("DefaultType") def Default(value: DefaultType) -> DefaultType: """Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 12:54:56 UTC 2025 - 5.1K bytes - Viewed (0) -
src/main/java/jcifs/Config.java
* @param key the property key to look up * @param def the default value to return if key is not found or cannot be parsed * @return the integer value of the property or the default value */ public static int getInt(final Properties props, final String key, int def) { final String s = props.getProperty(key); if (s != null) { try { def = Integer.parseInt(s);Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Sat Aug 16 01:32:48 UTC 2025 - 8.1K bytes - Viewed (0) -
tests/test_params_repr.py
test_data: list[Any] = ["teststr", None, ..., 1, []] def get_user(): return {} # pragma: no cover def test_param_repr_str(): assert repr(Param("teststr")) == "Param(teststr)" def test_param_repr_none(): assert repr(Param(None)) == "Param(None)" def test_param_repr_ellipsis(): assert repr(Param(...)) == "Param(PydanticUndefined)" def test_param_repr_number():
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 2.3K bytes - Viewed (0) -
tests/test_starlette_exception.py
def test_no_body_status_code_exception_handlers(): response = client.get("/http-no-body-statuscode-exception") assert response.status_code == 204 assert not response.content def test_no_body_status_code_with_detail_exception_handlers(): response = client.get("/http-no-body-statuscode-with-detail-exception") assert response.status_code == 204 assert not response.content def test_openapi_schema():
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 7.4K bytes - Viewed (0) -
tests/test_dependency_yield_scope.py
router = APIRouter() @router.get("/") def get_index(): return {"status": "ok"} @app.get("/function-scope") def function_scope(session: SessionFuncDep) -> Any: def iter_data(): yield json.dumps({"is_open": session.open}) return StreamingResponse(iter_data()) @app.get("/request-scope") def request_scope(session: SessionRequestDep) -> Any: def iter_data():
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 6.7K bytes - Viewed (0) -
docs_src/security/tutorial004_an_py310.py
app = FastAPI() def verify_password(plain_password, hashed_password): return password_hash.verify(plain_password, hashed_password) def get_password_hash(password): return password_hash.hash(password) def get_user(db, username: str): if username in db: user_dict = db[username] return UserInDB(**user_dict) def authenticate_user(fake_db, username: str, password: str):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Mon Sep 29 02:57:38 UTC 2025 - 4.1K bytes - Viewed (0) -
tests/test_file_and_form_order_issue_9116.py
@app.post("/file_before_form") def file_before_form( file: bytes = File(), city: str = Form(), ): return {"file_content": file, "city": city} @app.post("/file_after_form") def file_after_form( city: str = Form(), file: bytes = File(), ): return {"file_content": file, "city": city} @app.post("/file_list_before_form") def file_list_before_form(
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 2.3K bytes - Viewed (0) -
tests/test_additional_responses_router.py
}, ) async def c(): return "c" @router.get( "/d", responses={ "400": {"description": "Error with str"}, "5XX": {"model": ResponseModel}, "default": {"model": ResponseModel}, }, ) async def d(): return "d" app.include_router(router) client = TestClient(app) def test_a(): response = client.get("/a")Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 5.1K bytes - Viewed (0)