def test_find_phone_with_spaces_and_dashes2(self): line = "SMS from (585) 370-7180 " try: thing = tools.find_phone_number(line) except NoNumError as error: self.fail(" (504) 908-0034 should have parsed as an accceptable number.") pass
def test_find_phone_with_dash(self): line = "Some phone number: -(504) 908-0034 " try: thing = tools.find_phone_number(line) self.fail("-(504) 908-0034 shouldn't have parsed as a phone number.") except NoNumError as error: pass
def test_find_phone_with_incomplete_entry(self): line = "Some phone number: 04-908-0034 " try: thing = tools.find_phone_number(line) self.fail("04-908-0034 shouldn't have parsed as a phone number.") except NoNumError as error: ##Woo! it worked. pass
def test_find_phone_with_spaces_and_dashes2(self): line = "SMS from (585) 370-7180 " try: thing = tools.find_phone_number(line) except NoNumError as error: self.fail( " (504) 908-0034 should have parsed as an accceptable number.") pass
def test_find_phone_with_dash(self): line = "Some phone number: -(504) 908-0034 " try: thing = tools.find_phone_number(line) self.fail( "-(504) 908-0034 shouldn't have parsed as a phone number.") except NoNumError as error: pass
def test_find_phone_with_country_code3(self): """ """ line = "Some phone number: 3223-504-908-0034 " try: thing = tools.find_phone_number(line) self.fail(" 3223-504-908-0034 shouldn't have parsed as a phone number.") except NoNumError as error: pass
def test_find_phone_with_country_code3(self): """ """ line = "Some phone number: 3223-504-908-0034 " try: thing = tools.find_phone_number(line) self.fail( " 3223-504-908-0034 shouldn't have parsed as a phone number.") except NoNumError as error: pass
def test_find_phone_no_country_code(self): line = "Some phone number: (504) 908-0034 " self.assertEquals(tools.find_phone_number(line), "(504) 908-0034")