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

Method testFindAllByMethod

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

Source from the content-addressed store, hash-verified

90 self.assertEqual(len(self.soup(r)), 3)
91
92 def testFindAllByMethod(self):
93 def matchTagWhereIDMatchesName(tag):
94 return tag.name == tag.get('id')
95
96 matching = self.soup.findAll(matchTagWhereIDMatchesName)
97 self.assertEqual(len(matching), 2)
98 self.assertEqual(matching[0].name, 'a')
99
100 def testFindByIndex(self):
101 """For when you have the tag and you want to know where it is."""

Callers

nothing calls this directly

Calls 2

lenFunction · 0.85
findAllMethod · 0.80

Tested by

no test coverage detected