Beispiel #1
0
 def test_givenHTMLWithMultipleApartmentPlacardsReturnListWithMultipleApartments(
         self):
     html_soup = Scraper.get_html_text(self.test_response)
     apartments = Scraper.parse_soup_for_placards(html_soup)
     self.assertEqual(3, len(apartments))
Beispiel #2
0
 def test_givenHTMLResponseReturnsABeautifulSoupObject(self):
     html_soup = Scraper.get_html_text(self.test_response)
     self.assertIs(type(html_soup), BeautifulSoup)
Beispiel #3
0
 def test_givenHTMLWithApartmentPlacardReturnListWithOneApartment(self):
     html_soup = Scraper.get_html_text(self.test_response)
     apartment = Scraper.parse_soup_for_placards(html_soup)[0]
     self.assertEqual(self.test_apartment.url, apartment.url)
     self.assertEqual(self.test_apartment.location, apartment.location)
     self.assertEqual(self.test_apartment.rent, apartment.rent)
Beispiel #4
0
 def test_givenBlankResponseReturnBlankString(self):
     html_soup = ''
     self.assertEqual('', Scraper.get_html_text(html_soup))