MCPcopy
hub / github.com/pallets/werkzeug / test_cookie_default_path

Function test_cookie_default_path

tests/test_test.py:121–137  ·  view source on GitHub ↗

When no path is set for a cookie, the default uses everything up to but not including the first slash.

()

Source from the content-addressed store, hash-verified

119
120
121def test_cookie_default_path() -> None:
122 """When no path is set for a cookie, the default uses everything up to but not
123 including the first slash.
124 """
125
126 @Request.application
127 def app(request: Request) -> Response:
128 r = Response()
129 r.set_cookie("k", "v", path=None)
130 return r
131
132 c = Client(app)
133 c.get("/nested/leaf")
134 assert c.get_cookie("k") is None
135 assert c.get_cookie("k", path="/nested") is not None
136 c.get("/nested/dir/")
137 assert c.get_cookie("k", path="/nested/dir") is not None
138
139
140def test_environ_builder_basics():

Callers

nothing calls this directly

Calls 3

getMethod · 0.95
get_cookieMethod · 0.95
ClientClass · 0.90

Tested by

no test coverage detected