def test_extract_without_domain_and_brackets(self): text = "Some text bewtween brackets ([email protected])" self.assertEqual("*****@*****.**", extract_email(text)) text = "Some text start with bracket ([email protected]" self.assertEqual("*****@*****.**", extract_email(text)) text = "Some text bewtween brackets {[email protected]}" self.assertEqual("*****@*****.**", extract_email(text)) text = "Some text bewtween brackets [[email protected]]" self.assertEqual("*****@*****.**", extract_email(text))
def test_extract_without_domain_and_brackets(self): text = 'Some text bewtween brackets ([email protected])' self.assertEqual('*****@*****.**', extract_email(text)) text = 'Some text start with bracket ([email protected]' self.assertEqual('*****@*****.**', extract_email(text)) text = 'Some text bewtween brackets {[email protected]}' self.assertEqual('*****@*****.**', extract_email(text)) text = 'Some text bewtween brackets [[email protected]]' self.assertEqual('*****@*****.**', extract_email(text))
def test_extract_email_without_domain(self): text = "Some text [email protected]" self.assertEqual("*****@*****.**", extract_email(text)) text = "Some text [email protected] with something at the end" self.assertEqual("*****@*****.**", extract_email(text)) # Finds first email text = "Some text [email protected] with something at the" "end and other email like [email protected]" self.assertEqual("*****@*****.**", extract_email(text)) text = "[email protected] at the begginning" self.assertEqual("*****@*****.**", extract_email(text))
def test_extract_email_without_domain(self): text = 'Some text [email protected]' self.assertEqual('*****@*****.**', extract_email(text)) text = 'Some text [email protected] with something at the end' self.assertEqual('*****@*****.**', extract_email(text)) # Finds first email text = ('Some text [email protected] with something at the' 'end and other email like [email protected]') self.assertEqual('*****@*****.**', extract_email(text)) text = '[email protected] at the begginning' self.assertEqual('*****@*****.**', extract_email(text))
def test_extract_email(self): text = "Some text [email protected]" self.assertEqual("*****@*****.**", extract_email(text, "example.com")) text = "Some text [email protected] with something at the end" self.assertEqual("*****@*****.**", extract_email(text, "example.com")) text = "Some text [email protected] with something at the" "end and other email like [email protected]" self.assertEqual("*****@*****.**", extract_email(text, "example.com")) text = "Some text [email protected] with something at the" "end and other email like [email protected]" self.assertEqual("*****@*****.**", extract_email(text, "example.net")) text = "[email protected] at the begginning" self.assertEqual("*****@*****.**", extract_email(text, "example.com"))
def test_extract_email(self): text = 'Some text [email protected]' self.assertEqual('*****@*****.**', extract_email(text, 'example.com')) text = 'Some text [email protected] with something at the end' self.assertEqual('*****@*****.**', extract_email(text, 'example.com')) text = ('Some text [email protected] with something at the' 'end and other email like [email protected]') self.assertEqual('*****@*****.**', extract_email(text, 'example.com')) text = ('Some text [email protected] with something at the' 'end and other email like [email protected]') self.assertEqual('*****@*****.**', extract_email(text, 'example.net')) text = '[email protected] at the begginning' self.assertEqual('*****@*****.**', extract_email(text, 'example.com'))