MCPcopy
hub / github.com/csev/py4e / test_pickle_and_unpickle_identity

Method test_pickle_and_unpickle_identity

code3/bs4/testing.py:70–77  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

68 """
69
70 def test_pickle_and_unpickle_identity(self):
71 # Pickling a tree, then unpickling it, yields a tree identical
72 # to the original.
73 tree = self.soup("<a><b>foo</a>")
74 dumped = pickle.dumps(tree, 2)
75 loaded = pickle.loads(dumped)
76 self.assertEqual(loaded.__class__, BeautifulSoup)
77 self.assertEqual(loaded.decode(), tree.decode())
78
79 def assertDoctypeHandled(self, doctype_fragment):
80 """Assert that a given doctype string is handled correctly."""

Callers

nothing calls this directly

Calls 2

soupMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected