| 394 | self.assertTrue(p in {b"/?y=1&y=2&x=1", b"/?x=1&y=1&y=2"}) |
| 395 | |
| 396 | def test_setcookie(self): |
| 397 | urls = ("/", "index") |
| 398 | |
| 399 | class index: |
| 400 | def GET(self): |
| 401 | web.setcookie("foo", "bar") |
| 402 | return "hello" |
| 403 | |
| 404 | app = web.application(urls, locals()) |
| 405 | |
| 406 | def f(script_name=""): |
| 407 | response = app.request("/", env={"SCRIPT_NAME": script_name}) |
| 408 | return response.headers["Set-Cookie"] |
| 409 | |
| 410 | self.assertEqual(f(""), "foo=bar; Path=/") |
| 411 | self.assertEqual(f("/admin"), "foo=bar; Path=/admin/") |
| 412 | |
| 413 | def test_stopsimpleserver(self): |
| 414 | urls = ("/", "index") |