MCPcopy Index your code
hub / github.com/JoshData/python-email-validator / test_email_valid

Function test_email_valid

tests/test_syntax.py:145–161  ·  view source on GitHub ↗
(email_input: str, output: ValidatedEmail)

Source from the content-addressed store, hash-verified

143 ],
144)
145def test_email_valid(email_input: str, output: ValidatedEmail) -> None:
146 # These addresses do not require SMTPUTF8. See test_email_valid_intl_local_part
147 # for addresses that are valid but require SMTPUTF8. Check that it passes with
148 # allow_smtput8 both on and off.
149 emailinfo = validate_email(email_input, check_deliverability=False, allow_smtputf8=False,
150 allow_quoted_local=True, allow_display_name=True)
151
152 assert emailinfo == output
153 assert validate_email(email_input, check_deliverability=False, allow_smtputf8=True,
154 allow_quoted_local=True, allow_display_name=True) == output
155
156 # Check that the old `email` attribute to access the normalized form still works
157 # if the DeprecationWarning is suppressed.
158 import warnings
159 with warnings.catch_warnings():
160 warnings.filterwarnings("ignore", category=DeprecationWarning)
161 assert emailinfo.email == emailinfo.normalized
162
163
164@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

validate_emailFunction · 0.90

Tested by

no test coverage detected