MCPcopy Index your code
hub / github.com/webpy/webpy / test_setcookie

Method test_setcookie

tests/test_application.py:396–411  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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")

Callers

nothing calls this directly

Calls 1

fFunction · 0.85

Tested by

no test coverage detected