MCPcopy Create free account
hub / github.com/clips/pattern / testSiblings

Method testSiblings

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

Source from the content-addressed store, hash-verified

180 "Tests the nextSibling and previousSibling navigation."
181
182 def testSiblings(self):
183 soup = BeautifulSoup("<ul><li>1<p>A</p>B<li>2<li>3</ul>")
184 secondLI = soup.find('li').nextSibling
185 self.assert_(secondLI.name == 'li' and secondLI.string == '2')
186 self.assertEquals(soup.find(text='1').nextSibling.name, 'p')
187 self.assertEquals(soup.find('p').nextSibling, 'B')
188 self.assertEquals(soup.find('p').nextSibling.previousSibling.nextSibling, 'B')
189
190class TagsAreObjectsToo(SoupTest):
191 "Tests the various built-in functions of Tag objects."

Callers

nothing calls this directly

Calls 2

BeautifulSoupClass · 0.90
findMethod · 0.45

Tested by

no test coverage detected