(self)
| 573 | r'expires=\w+, \d+ \w+ \d+ \d+:\d+:\d+ \w+') |
| 574 | |
| 575 | def test_control_characters(self): |
| 576 | for c0 in support.control_characters_c0(): |
| 577 | morsel = cookies.Morsel() |
| 578 | |
| 579 | # .__setitem__() |
| 580 | with self.assertRaises(cookies.CookieError): |
| 581 | morsel[c0] = "val" |
| 582 | with self.assertRaises(cookies.CookieError): |
| 583 | morsel["path"] = c0 |
| 584 | |
| 585 | # .setdefault() |
| 586 | with self.assertRaises(cookies.CookieError): |
| 587 | morsel.setdefault("path", c0) |
| 588 | with self.assertRaises(cookies.CookieError): |
| 589 | morsel.setdefault(c0, "val") |
| 590 | |
| 591 | # .set() |
| 592 | with self.assertRaises(cookies.CookieError): |
| 593 | morsel.set(c0, "val", "coded-value") |
| 594 | with self.assertRaises(cookies.CookieError): |
| 595 | morsel.set("path", c0, "coded-value") |
| 596 | with self.assertRaises(cookies.CookieError): |
| 597 | morsel.set("path", "val", c0) |
| 598 | |
| 599 | def test_control_characters_output(self): |
| 600 | # Tests that even if the internals of Morsel are modified |
nothing calls this directly
no test coverage detected