MCPcopy
hub / github.com/tornadoweb/tornado / test_pickle_roundtrip

Method test_pickle_roundtrip

tornado/test/httputil_test.py:516–524  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

514 self.assertIsNot(headers.get_list("A"), h1.get_list("A"))
515
516 def test_pickle_roundtrip(self):
517 headers = HTTPHeaders()
518 headers.add("Set-Cookie", "a=b")
519 headers.add("Set-Cookie", "c=d")
520 headers.add("Content-Type", "text/html")
521 pickled = pickle.dumps(headers)
522 unpickled = pickle.loads(pickled)
523 self.assertEqual(sorted(headers.get_all()), sorted(unpickled.get_all()))
524 self.assertEqual(sorted(headers.items()), sorted(unpickled.items()))
525
526 def test_setdefault(self):
527 headers = HTTPHeaders()

Callers

nothing calls this directly

Calls 4

addMethod · 0.95
get_allMethod · 0.95
HTTPHeadersClass · 0.90
itemsMethod · 0.80

Tested by

no test coverage detected