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

Method test_load

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

Source from the content-addressed store, hash-verified

144 self.assertEqual(len(value), n + 3)
145
146 def test_load(self):
147 C = cookies.SimpleCookie()
148 C.load('Customer="WILE_E_COYOTE"; Version=1; Path=/acme')
149
150 self.assertEqual(C['Customer'].value, 'WILE_E_COYOTE')
151 self.assertEqual(C['Customer']['version'], '1')
152 self.assertEqual(C['Customer']['path'], '/acme')
153
154 self.assertEqual(C.output(['path']),
155 'Set-Cookie: Customer="WILE_E_COYOTE"; Path=/acme')
156 self.assertEqual(C.js_output(), r"""
157 <script type="text/javascript">
158 <!-- begin hiding
159 document.cookie = "Customer=\"WILE_E_COYOTE\"; Path=/acme; Version=1";
160 // end hiding -->
161 </script>
162 """)
163 self.assertEqual(C.js_output(['path']), r"""
164 <script type="text/javascript">
165 <!-- begin hiding
166 document.cookie = "Customer=\"WILE_E_COYOTE\"; Path=/acme";
167 // end hiding -->
168 </script>
169 """)
170
171 def test_extended_encode(self):
172 # 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