Пример #1
0
    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))
Пример #2
0
    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))
Пример #3
0
    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))
Пример #4
0
    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))
Пример #5
0
    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"))
Пример #6
0
    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'))