Exemplo n.º 1
0
 def test__get_page_soup_returns_bs4(self, mock_requests):
     mock_requests.get.return_value.content = b'<h1>Test</h1>'
     scrape = PageScraper('www.google.com')
     scrape._get_page_contents()
     soup = scrape._get_page_soup()
     self.assertEqual(soup.get_text(), 'Test')
Exemplo n.º 2
0
 def test__get_page_contents_returns_content(self, mock_requests):
     mock_requests.get.return_value.content = b'page content'
     scraper = PageScraper('www.google.com')
     self.assertEqual(scraper._get_page_contents(), 'page content')