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

Method test_insert_string

code3/pagerank/bs4/tests/test_tree.py:856–863  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

soupMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected