theHarvester/tests/test_myparser.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
521 B
Python
Raw Normal View History

#!/usr/bin/env python3
# coding=utf-8
import pytest
2019-03-24 15:53:59 +08:00
from theHarvester.parsers import myparser
2023-07-26 23:27:29 +08:00
class TestMyParser(object):
2020-01-04 15:24:09 +08:00
@pytest.mark.asyncio
2022-10-31 08:51:59 +08:00
async def test_emails(self) -> None:
word = "domain.com"
results = "@domain.com***a@domain***banotherdomain.com***c@domain.com***d@sub.domain.com***"
parse = myparser.Parser(results, word)
2020-01-04 15:24:09 +08:00
emails = sorted(await parse.emails())
assert emails, ["c@domain.com", "d@sub.domain.com"]
if __name__ == "__main__":
2019-08-20 05:50:32 +08:00
pytest.main()