Ejemplo n.º 1
0
 def test_no_bedrooms(self):
     tag_mock = Mock()
     tag_mock.text = ''
     self.link_html.find = Mock(return_value=tag_mock)
     number_bedrooms = listing.extract_number_bedrooms(
         self.link_html, self.page_html, self.unhidden_page_html)
     self.assertIsNone(number_bedrooms)
Ejemplo n.º 2
0
 def test_extract_number_bedrooms(self):
     tag_mock = Mock()
     tag_mock.text = " / 3br - 730ft2 - "
     self.link_html.find = Mock(return_value=tag_mock)
     number_bedrooms = listing.extract_number_bedrooms(
         self.link_html, self.page_html, self.unhidden_page_html)
     self.assertEqual(number_bedrooms, 3)