When no path is set for a cookie, the default uses everything up to but not including the first slash.
()
| 119 | |
| 120 | |
| 121 | def 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 | |
| 140 | def test_environ_builder_basics(): |
nothing calls this directly
no test coverage detected