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

Method testFindallByClass

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

Source from the content-addressed store, hash-verified

63 self.assertEqual(len(self.soup.findAll(href=True)), 1)
64
65 def testFindallByClass(self):
66 soup = BeautifulSoup('<b class="foo">Foo</b><a class="1 23 4">Bar</a>')
67 self.assertEqual(soup.find(attrs='foo').string, "Foo")
68 self.assertEqual(soup.find('a', '1').string, "Bar")
69 self.assertEqual(soup.find('a', '23').string, "Bar")
70 self.assertEqual(soup.find('a', '4').string, "Bar")
71
72 self.assertEqual(soup.find('a', '2'), None)
73
74 def testFindAllByList(self):
75 matching = self.soup(['a', 'ac'])

Callers

nothing calls this directly

Calls 2

BeautifulSoupClass · 0.90
findMethod · 0.45

Tested by

no test coverage detected