-
Notifications
You must be signed in to change notification settings - Fork 572
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf76938
commit 0b6e883
Showing
3 changed files
with
12 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,22 @@ | |
|
||
|
||
class TestEmais(ModuleTestBase): | ||
modules_overrides = ["emails", "emailformat"] | ||
modules_overrides = ["emails", "emailformat", "skymem"] | ||
|
||
async def setup_before_prep(self, module_test): | ||
module_test.httpx_mock.add_response( | ||
url="https://www.email-format.com/d/blacklanternsecurity.com/", | ||
text="<p>[email protected]</a>", | ||
text="<p>[email protected]</p>", | ||
) | ||
module_test.httpx_mock.add_response( | ||
url="https://www.skymem.info/srch?q=blacklanternsecurity.com", | ||
text="<p>[email protected]</p>", | ||
) | ||
|
||
def check(self, module_test, events): | ||
sub_file = module_test.scan.home / "emails.txt" | ||
emails = set(open(sub_file).read().splitlines()) | ||
assert emails == {"[email protected]"} | ||
assert 2 == len([e for e in events if e.data == "[email protected]"]) | ||
email_file = module_test.scan.home / "emails.txt" | ||
emails = open(email_file).read().splitlines() | ||
# make sure deduping works as intended | ||
assert len(emails) == 1 | ||
assert set(emails) == {"[email protected]"} |