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

Method test_bad_cookies

tests/test_http.py:511–523  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

509 assert http.dump_cookie("key", "xxx=", path=None) == "key=xxx="
510
511 def test_bad_cookies(self):
512 cookies = http.parse_cookie(
513 "first=IamTheFirst ; a=1; oops ; a=2 ;second = andMeTwo;"
514 )
515 expect = {
516 "first": ["IamTheFirst"],
517 "a": ["1", "2"],
518 "oops": [""],
519 "second": ["andMeTwo"],
520 }
521 assert cookies.to_dict(flat=False) == expect
522 assert cookies["a"] == "1"
523 assert cookies.getlist("a") == ["1", "2"]
524
525 def test_empty_keys_are_ignored(self):
526 cookies = http.parse_cookie("spam=ham; duck=mallard; ; ")

Callers

nothing calls this directly

Calls 2

to_dictMethod · 0.80
getlistMethod · 0.45

Tested by

no test coverage detected