(self)
| 1169 | self.assertFalse(req.has_header("Cookie")) |
| 1170 | |
| 1171 | def test_secure(self): |
| 1172 | for ns in True, False: |
| 1173 | for whitespace in " ", "": |
| 1174 | c = CookieJar() |
| 1175 | if ns: |
| 1176 | pol = DefaultCookiePolicy(rfc2965=False) |
| 1177 | int = interact_netscape |
| 1178 | vs = "" |
| 1179 | else: |
| 1180 | pol = DefaultCookiePolicy(rfc2965=True) |
| 1181 | int = interact_2965 |
| 1182 | vs = "; Version=1" |
| 1183 | c.set_policy(pol) |
| 1184 | url = "http://www.acme.com/" |
| 1185 | int(c, url, "foo1=bar%s%s" % (vs, whitespace)) |
| 1186 | int(c, url, "foo2=bar%s; secure%s" % (vs, whitespace)) |
| 1187 | self.assertFalse( |
| 1188 | c._cookies["www.acme.com"]["/"]["foo1"].secure, |
| 1189 | "non-secure cookie registered secure") |
| 1190 | self.assertTrue( |
| 1191 | c._cookies["www.acme.com"]["/"]["foo2"].secure, |
| 1192 | "secure cookie registered non-secure") |
| 1193 | |
| 1194 | def test_secure_block(self): |
| 1195 | pol = DefaultCookiePolicy() |
nothing calls this directly
no test coverage detected