コード例 #1
0
 def test_p_em(self):
     body = '<p><em>{}</em>, by {}, and some other info.</p>'.format(
         self.title, self.author)
     website = self.header + body + self.footer
     result = scraper.getBookData(website)
     self.assertEqual(result,
                      [['Shame of the Wind', 'Patrick Shoggothfuss']])
コード例 #2
0
 def test_p_ahref(self):
     body = '<p><a href="heh">{}</a>, some info by {}</p>'.format(
         self.title, self.author)
     website = self.header + body + self.footer
     result = scraper.getBookData(website)
     self.assertEqual(result,
                      [['Shame of the Wind', 'Patrick Shoggothfuss']])
コード例 #3
0
 def test_p_a_em_a(self):
     body = '<p><a href="a"><em>{}</em></a>, by {},<a href="b">stuff</a>more</p>'.format(
         self.title, self.author)
     website = self.header + body + self.footer
     result = scraper.getBookData(website)
     self.assertEqual(result,
                      [['Shame of the Wind', 'Patrick Shoggothfuss']])