(self)
| 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 |
nothing calls this directly
no test coverage detected