(self)
| 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.""" |