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

Method test_pickle

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

Source from the content-addressed store, hash-verified

541 self.assertRaises(TypeError, morsel.update, 0)
542
543 def test_pickle(self):
544 morsel_a = cookies.Morsel()
545 morsel_a.set('foo', 'bar', 'baz')
546 morsel_a.update({
547 'version': 2,
548 'comment': 'foo',
549 })
550 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
551 with self.subTest(proto=proto):
552 morsel_b = pickle.loads(pickle.dumps(morsel_a, proto))
553 self.assertIsInstance(morsel_b, cookies.Morsel)
554 self.assertEqual(morsel_b, morsel_a)
555 self.assertEqual(str(morsel_b), str(morsel_a))
556
557 def test_repr(self):
558 morsel = cookies.Morsel()

Callers

nothing calls this directly

Calls 8

setMethod · 0.95
updateMethod · 0.95
strFunction · 0.85
assertIsInstanceMethod · 0.80
subTestMethod · 0.45
loadsMethod · 0.45
dumpsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected