MCPcopy Create free account
hub / github.com/pallets/quart / test_secure_cookie_session_interface_open_session

Function test_secure_cookie_session_interface_open_session

tests/test_sessions.py:16–39  ·  view source on GitHub ↗
(
    http_scope: HTTPScope,
)

Source from the content-addressed store, hash-verified

14
15
16async def test_secure_cookie_session_interface_open_session(
17 http_scope: HTTPScope,
18) -> None:
19 session = SecureCookieSession()
20 session["something"] = "else"
21 interface = SecureCookieSessionInterface()
22 app = Quart(__name__)
23 app.secret_key = "secret"
24 response = Response("")
25 await interface.save_session(app, session, response)
26 request = Request(
27 "GET",
28 "http",
29 "/",
30 b"",
31 Headers(),
32 "",
33 "1.1",
34 http_scope,
35 send_push_promise=no_op_push,
36 )
37 request.headers["Cookie"] = response.headers["Set-Cookie"]
38 new_session = await interface.open_session(app, request)
39 assert new_session == session
40
41
42async def test_secure_cookie_session_interface_save_session() -> None:

Callers

nothing calls this directly

Calls 6

save_sessionMethod · 0.95
open_sessionMethod · 0.95
QuartClass · 0.90
ResponseClass · 0.90
RequestClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…