mirror of
https://github.com/laramies/theHarvester.git
synced 2025-02-23 22:13:02 +08:00
18 lines
429 B
Python
18 lines
429 B
Python
#
|
|
# Unit tests for myparser.py
|
|
#
|
|
import myparser
|
|
|
|
import unittest
|
|
|
|
class TestMyParser(unittest.TestCase):
|
|
|
|
def test_emails(self):
|
|
word = 'domain.com'
|
|
results = '***a@domain***banotherdomain.com***c@domain.com***d@sub.domain.com***'
|
|
p = myparser.parser(results, word)
|
|
emails = sorted(p.emails())
|
|
self.assertEquals(emails, [ 'c@domain.com', 'd@sub.domain.com' ])
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|