Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/minfraud/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
"fastemailer.com",
"fastest.cc",
"fastimap.com",
"fastmail.ca",
"fastmail.cn",
"fastmail.co.uk",
"fastmail.com",
Expand Down Expand Up @@ -210,6 +211,7 @@
}

_YAHOO_DOMAINS = {
"myyahoo.com",
"y7mail.com",
"yahoo.at",
"yahoo.be",
Expand Down
2 changes: 2 additions & 0 deletions tests/test_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ def test_clean_email(self) -> None:
{"input": "foo@googlemail.com", "output": "foo@gmail.com"},
{"input": "foo.bar@gmail.com", "output": "foobar@gmail.com"},
{"input": "alias@user.fastmail.com", "output": "user@fastmail.com"},
{"input": "alias@user.fastmail.ca", "output": "user@fastmail.ca"},
{"input": "foo-bar@ymail.com", "output": "foo@ymail.com"},
{"input": "test-alias@myyahoo.com", "output": "test@myyahoo.com"},
Comment on lines +246 to +248

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Cover the new aliases in hashed-email tests.

These cases exercise _clean_email only. Add corresponding maybe_hash_email cases for both domains, including expected MD5 values and normalized domain fields for aliased and already-normalized addresses.

As per coding guidelines, tests/test_request.py email normalization changes must test raw and hashed email results, including empty strings and already-normalized addresses.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_request.py` around lines 246 - 248, Add corresponding
maybe_hash_email coverage in the email normalization tests for the Fastmail and
Yahoo alias domains, asserting expected MD5 values and normalized domain fields
for aliased and already-normalized addresses; also retain coverage for raw and
hashed empty-string inputs as required by the existing test conventions.

Source: Coding guidelines

{"input": "foo@example.com.com", "output": "foo@example.com"},
{"input": "foo@example.comfoo", "output": "foo@example.comfoo"},
{"input": "foo@example.cam", "output": "foo@example.cam"},
Expand Down
Loading