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

Method test_pickle

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

Source from the content-addressed store, hash-verified

317 self.assertEqual(C.output(), '')
318
319 def test_pickle(self):
320 rawdata = 'Customer="WILE_E_COYOTE"; Path=/acme; Version=1'
321 expected_output = 'Set-Cookie: %s' % rawdata
322
323 C = cookies.SimpleCookie()
324 C.load(rawdata)
325 self.assertEqual(C.output(), expected_output)
326
327 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
328 with self.subTest(proto=proto):
329 C1 = pickle.loads(pickle.dumps(C, protocol=proto))
330 self.assertEqual(C1.output(), expected_output)
331
332 def test_illegal_chars(self):
333 rawdata = "a=b; c,d=e"

Callers

nothing calls this directly

Calls 6

loadMethod · 0.45
assertEqualMethod · 0.45
outputMethod · 0.45
subTestMethod · 0.45
loadsMethod · 0.45
dumpsMethod · 0.45

Tested by

no test coverage detected