MCPcopy Index your code
hub / github.com/csev/py4e / test_insert_string

Method test_insert_string

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

Source from the content-addressed store, hash-verified

855 self.assertEqual(new_text.next_element, soup.c)
856
857 def test_insert_string(self):
858 soup = self.soup("<a></a>")
859 soup.a.insert(0, "bar")
860 soup.a.insert(0, "foo")
861 # The string were added to the tag.
862 self.assertEqual(["foo", "bar"], soup.a.contents)
863 # And they were converted to NavigableStrings.
864 self.assertEqual(soup.a.contents[0].next_element, "bar")
865
866 def test_insert_tag(self):
867 builder = self.default_builder

Callers

nothing calls this directly

Calls 2

soupMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected