def test_invalid_email(self): sentence = "[email protected]" self.assertIsNone(get_email(sentence))
def test_two_emails(self): sentence = "[email protected] [email protected]" self.assertEqual(get_email(sentence), "*****@*****.**")
def test_only_email(self): self.assertEqual(get_email("*****@*****.**"), "*****@*****.**")
def test_punctuation_after_email(self): sentence = "Email is [email protected]." self.assertEqual(get_email(sentence), "*****@*****.**")
def test_ending_in_email(self): sentence = "String with email [email protected]" self.assertEqual(get_email(sentence), "*****@*****.**")