MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_quoted_meta

Method test_quoted_meta

Lib/test/test_http_cookies.py:261–284  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

259 'Set-Cookie: eggs=scrambled; Path=bar; Secure\r\nSet-Cookie: foo=foo')
260
261 def test_quoted_meta(self):
262 # Try cookie with quoted meta-data
263 C = cookies.SimpleCookie()
264 C.load('Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"')
265 self.assertEqual(C['Customer'].value, 'WILE_E_COYOTE')
266 self.assertEqual(C['Customer']['version'], '1')
267 self.assertEqual(C['Customer']['path'], '/acme')
268
269 self.assertEqual(C.output(['path']),
270 'Set-Cookie: Customer="WILE_E_COYOTE"; Path=/acme')
271 self.assertEqual(C.js_output(), r"""
272 <script type="text/javascript">
273 <!-- begin hiding
274 document.cookie = "Customer=\"WILE_E_COYOTE\"; Path=/acme; Version=1";
275 // end hiding -->
276 </script>
277 """)
278 self.assertEqual(C.js_output(['path']), r"""
279 <script type="text/javascript">
280 <!-- begin hiding
281 document.cookie = "Customer=\"WILE_E_COYOTE\"; Path=/acme";
282 // end hiding -->
283 </script>
284 """)
285
286 def test_invalid_cookies(self):
287 # Accepting these could be a security issue

Callers

nothing calls this directly

Calls 4

loadMethod · 0.45
assertEqualMethod · 0.45
outputMethod · 0.45
js_outputMethod · 0.45

Tested by

no test coverage detected