Description
The providers.py module includes a KNOWN_PROVIDERS dictionary with 50+ email providers (Gmail, Outlook, Yahoo, iCloud, Zoho, ProtonMail, AOL, Yandex, etc.), but the test suite only verifies Gmail resolution. All other providers, including the DNS SRV/MX fallback logic, are untested.
Location
email_profile/providers.py — KNOWN_PROVIDERS dict, resolve_imap_host(), resolve_smtp_host()
tests/test_providers.py — 5 tests (Gmail only)
Current Test Coverage
# tests/test_providers.py
class TestResolveImapHost:
def test_known_provider(self):
host = resolve_imap_host("user@gmail.com") # Only Gmail tested!
assert host["server"] == "imap.gmail.com"
def test_unknown_domain(self): ... # Fallback logic
def test_srv_override(self): ... # SRV record
def test_mx_hint(self): ... # MX-based resolution
def test_invalid_email(self): ... # Validation
What's missing
| Provider |
IMAP Server |
Tested? |
| Gmail |
imap.gmail.com |
Yes |
| Outlook |
outlook.office365.com |
No |
| Yahoo |
imap.mail.yahoo.com |
No |
| iCloud |
imap.mail.me.com |
No |
| ProtonMail |
127.0.0.1:1143 |
No |
| Zoho |
imap.zoho.com |
No |
| All others (44+) |
... |
No |
SMTP resolution — 0 tests
resolve_smtp_host() # Completely untested function
Suggested Tests
import pytest
PROVIDER_CASES = [
("user@gmail.com", "imap.gmail.com"),
("user@outlook.com", "outlook.office365.com"),
("user@yahoo.com", "imap.mail.yahoo.com"),
("user@icloud.com", "imap.mail.me.com"),
("user@zoho.com", "imap.zoho.com"),
("user@aol.com", "imap.aol.com"),
("user@yandex.com", "imap.yandex.com"),
("user@mail.ru", "imap.mail.ru"),
]
@pytest.mark.parametrize("email,expected_server", PROVIDER_CASES)
def test_known_providers(email, expected_server):
host = resolve_imap_host(email)
assert host["server"] == expected_server
Impact
Who: Users of non-Gmail providers — they discover bugs only at runtime.
Severity: Medium — regression in any provider mapping breaks auto-discovery for those users.
Priority
Medium
Description
The
providers.pymodule includes aKNOWN_PROVIDERSdictionary with 50+ email providers (Gmail, Outlook, Yahoo, iCloud, Zoho, ProtonMail, AOL, Yandex, etc.), but the test suite only verifies Gmail resolution. All other providers, including the DNS SRV/MX fallback logic, are untested.Location
email_profile/providers.py—KNOWN_PROVIDERSdict,resolve_imap_host(),resolve_smtp_host()tests/test_providers.py— 5 tests (Gmail only)Current Test Coverage
What's missing
SMTP resolution — 0 tests
Suggested Tests
Impact
Who: Users of non-Gmail providers — they discover bugs only at runtime.
Severity: Medium — regression in any provider mapping breaks auto-discovery for those users.
Priority
Medium