MCPcopy Index your code
hub / github.com/python/cpython / test_load

Method test_load

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

Source from the content-addressed store, hash-verified

166 self.assertEqual(len(value), n + 3)
167
168 def test_load(self):
169 C = cookies.SimpleCookie()
170 C.load('Customer="WILE_E_COYOTE"; Version=1; Path=/acme')
171
172 self.assertEqual(C['Customer'].value, 'WILE_E_COYOTE')
173 self.assertEqual(C['Customer']['version'], '1')
174 self.assertEqual(C['Customer']['path'], '/acme')
175
176 self.assertEqual(C.output(['path']),
177 'Set-Cookie: Customer="WILE_E_COYOTE"; Path=/acme')
178 self.assertEqual(C.js_output(), r"""
179 <script type="text/javascript">
180 <!-- begin hiding
181 document.cookie = "Customer=\"WILE_E_COYOTE\"; Path=/acme; Version=1";
182 // end hiding -->
183 </script>
184 """)
185 self.assertEqual(C.js_output(['path']), r"""
186 <script type="text/javascript">
187 <!-- begin hiding
188 document.cookie = "Customer=\"WILE_E_COYOTE\"; Path=/acme";
189 // end hiding -->
190 </script>
191 """)
192
193 def test_extended_encode(self):
194 # Issue 9824: some browsers don't follow the standard; we now

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