MCPcopy Index your code
hub / github.com/clips/pattern / testAppend

Method testAppend

pattern/web/soup/BeautifulSoupTests.py:417–426  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

415 self.assertEqual(soup.top.contents[1].name, "child2")
416
417 def testAppend(self):
418 doc = "<p>Don't leave me <b>here</b>.</p> <p>Don't leave me.</p>"
419 soup = BeautifulSoup(doc)
420 second_para = soup('p')[1]
421 bold = soup.find('b')
422 soup('p')[1].append(soup.find('b'))
423 self.assertEqual(bold.parent, second_para)
424 self.assertEqual(str(soup),
425 "<p>Don't leave me .</p> "
426 "<p>Don't leave me.<b>here</b></p>")
427
428 def testTagExtraction(self):
429 # A very simple case

Callers

nothing calls this directly

Calls 4

BeautifulSoupClass · 0.90
strFunction · 0.85
findMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected