Exemplo n.º 1
0
 def test_multiple_telephone_numbers(self):
     self.unhidden_page_html.text = "Call at 123-456-7890 or 098-765-4321"
     telephone_numbers = listing.extract_telephone_numbers(
         self.link_html, self.page_html, self.unhidden_page_html)
     self.assertEqual(telephone_numbers, ['1234567890', '0987654321'])
Exemplo n.º 2
0
 def test_formatted_telephone_number(self):
     self.unhidden_page_html.text = "Call at (123) 456-7890"
     telephone_numbers = listing.extract_telephone_numbers(
         self.link_html, self.page_html, self.unhidden_page_html)
     self.assertEqual(telephone_numbers, ['1234567890'])
Exemplo n.º 3
0
 def test_no_telephone_numbers(self):
     self.unhidden_page_html.text = "Please contact me on craigslist"
     telephone_numbers = listing.extract_telephone_numbers(
         self.link_html, self.page_html, self.unhidden_page_html)
     self.assertIsNone(telephone_numbers)