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

Method test_unwrap

code3/bs4/tests/test_tree.py:1017–1023  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1015 self.assertEqual(g_tag.previous_sibling, to_text)
1016
1017 def test_unwrap(self):
1018 tree = self.soup("""
1019 <p>Unneeded <em>formatting</em> is unneeded</p>
1020 """)
1021 tree.em.unwrap()
1022 self.assertEqual(tree.em, None)
1023 self.assertEqual(tree.p.text, "Unneeded formatting is unneeded")
1024
1025 def test_wrap(self):
1026 soup = self.soup("I wish I was bold.")

Callers

nothing calls this directly

Calls 2

soupMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected