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

Method testParents

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

Source from the content-addressed store, hash-verified

121 self.assertEqual(soup.findAll(True, text='Baz'), ['Baz'])
122
123 def testParents(self):
124 soup = BeautifulSoup('<ul id="foo"></ul><ul id="foo"><ul><ul id="foo" a="b"><b>Blah')
125 b = soup.b
126 self.assertEquals(len(b.findParents('ul', {'id' : 'foo'})), 2)
127 self.assertEquals(b.findParent('ul')['a'], 'b')
128
129 PROXIMITY_TEST = BeautifulSoup('<b id="1"><b id="2"><b id="3"><b id="4">')
130

Callers

nothing calls this directly

Calls 4

BeautifulSoupClass · 0.90
lenFunction · 0.85
findParentsMethod · 0.80
findParentMethod · 0.80

Tested by

no test coverage detected