- Sort Score
- Result 10 results
- Languages All
Results 71 - 80 of 1,452 for def (0.01 sec)
-
tests/test_tutorial/test_security/test_tutorial005.py
def test_verify_password(): assert verify_password("secret", fake_users_db["johndoe"]["hashed_password"]) def test_get_password_hash(): assert get_password_hash("secretalice") def test_create_access_token(): access_token = create_access_token(data={"data": "foo"}) assert access_token def test_token_no_sub(): response = client.get(
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Mar 13 19:07:10 UTC 2024 - 15.4K bytes - Viewed (0) -
tests/test_datastructures.py
# TODO: remove when deprecating Pydantic v1 def test_upload_file_invalid(): with pytest.raises(ValueError): UploadFile.validate("not a Starlette UploadFile") def test_upload_file_invalid_pydantic_v2(): with pytest.raises(ValueError): UploadFile._validate("not a Starlette UploadFile", {}) def test_default_placeholder_equals(): placeholder_1 = Default("a")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 18 12:36:40 UTC 2023 - 2K bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial012.py
}, ] } ) def test_get_invalid_one_header_items(): response = client.get("/items/", headers={"X-Token": "invalid"}) assert response.status_code == 400, response.text assert response.json() == {"detail": "X-Token header invalid"} def test_get_invalid_one_users(): response = client.get("/users/", headers={"X-Token": "invalid"})
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 8.4K bytes - Viewed (0) -
tests/test_dependency_cache.py
counter_holder = {"counter": 0} async def dep_counter(): counter_holder["counter"] += 1 return counter_holder["counter"] async def super_dep(count: int = Depends(dep_counter)): return count @app.get("/counter/") async def get_counter(count: int = Depends(dep_counter)): return {"counter": count} @app.get("/sub-counter/") async def get_sub_counter(
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Aug 23 13:30:24 UTC 2022 - 2.7K bytes - Viewed (0) -
tests/test_tutorial/test_request_form_models/test_tutorial002_pv1_an_p39.py
from tests.utils import needs_py39, needs_pydanticv1 @pytest.fixture(name="client") def get_client(): from docs_src.request_form_models.tutorial002_pv1_an_py39 import app client = TestClient(app) return client # TODO: remove when deprecating Pydantic v1 @needs_pydanticv1 @needs_py39 def test_post_body_form(client: TestClient):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Sep 06 17:31:18 UTC 2024 - 6.5K bytes - Viewed (0) -
tests/test_security_openid_connect.py
class User(BaseModel): username: str def get_current_user(oauth_header: str = Security(oid)): user = User(username=oauth_header) return user @app.get("/users/me") def read_current_user(current_user: User = Depends(get_current_user)): return current_user client = TestClient(app) def test_security_oauth2():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.2K bytes - Viewed (0) -
tests/test_security_openid_connect_description.py
) class User(BaseModel): username: str def get_current_user(oauth_header: str = Security(oid)): user = User(username=oauth_header) return user @app.get("/users/me") def read_current_user(current_user: User = Depends(get_current_user)): return current_user client = TestClient(app) def test_security_oauth2():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.4K bytes - Viewed (0) -
build-logic/documentation/src/main/groovy/gradlebuild/docs/dsl/docbook/model/ClassDoc.groovy
def getPropertiesSection() { return propertiesSection } def getPropertyDetailsSection() { return getSection('Property details') } Element getMethodsTable() { return methodsTable } def getMethodsSection() { return methodsSection } def getMethodDetailsSection() { return getSection('Method details') } def getBlocksTable() { return getTable('Script blocks') }
Registered: Wed Nov 06 11:36:14 UTC 2024 - Last Modified: Wed Dec 09 08:14:05 UTC 2020 - 6.2K bytes - Viewed (0) -
docs_src/websockets/tutorial003_py39.py
</html> """ class ConnectionManager: def __init__(self): self.active_connections: list[WebSocket] = [] async def connect(self, websocket: WebSocket): await websocket.accept() self.active_connections.append(websocket) def disconnect(self, websocket: WebSocket): self.active_connections.remove(websocket) async def send_personal_message(self, message: str, websocket: WebSocket):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 2.5K bytes - Viewed (0) -
build-logic/build-update-utils/src/test/groovy/gradlebuild/buildutils/tasks/UpdateReleasedVersionsTest.groovy
def format = new SimpleDateFormat('yyyyMMddHHmmssZ') def setup() { format.timeZone = TimeZone.getTimeZone("UTC") } def "final release is added to list"() { def snapshot = snapshot('4.3') def rc = releasedVersion('4.3-rc-1') def versions = releasedVersions(snapshot, rc, []) def version = new ReleasedVersion('4.2', '20170913122310+0000')
Registered: Wed Nov 06 11:36:14 UTC 2024 - Last Modified: Wed Dec 09 08:14:05 UTC 2020 - 5.4K bytes - Viewed (0)