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

Method testPrevious

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

Source from the content-addressed store, hash-verified

137 self.assertEquals(len(b.findAllNext('b', {'id' : 4})), 1)
138
139 def testPrevious(self):
140 soup = self.PROXIMITY_TEST
141 b = soup.find('b', {'id' : 3})
142 self.assertEquals(b.findPrevious('b')['id'], '2')
143 self.assertEquals(b.findPrevious('b')['id'], '2')
144 self.assertEquals(len(b.findAllPrevious('b')), 2)
145 self.assertEquals(len(b.findAllPrevious('b', {'id' : 2})), 1)
146
147
148 SIBLING_TEST = BeautifulSoup('<blockquote id="1"><blockquote id="1.1"></blockquote></blockquote><blockquote id="2"><blockquote id="2.1"></blockquote></blockquote><blockquote id="3"><blockquote id="3.1"></blockquote></blockquote><blockquote id="4">')

Callers

nothing calls this directly

Calls 4

lenFunction · 0.85
findPreviousMethod · 0.80
findAllPreviousMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected