diff options
| author | Bobby <[email protected]> | 2022-09-10 20:29:09 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-09-10 20:29:09 -0400 |
| commit | 5085e5d09086766e2b3a55f6d9e2f797015f25d0 (patch) | |
| tree | 7bc5f0dff1384867cf4d58efcc872543119bf727 /tests | |
| parent | 6361141215b89942105203f91d34a2794d89a295 (diff) | |
| download | edify-5085e5d09086766e2b3a55f6d9e2f797015f25d0.tar.xz edify-5085e5d09086766e2b3a55f6d9e2f797015f25d0.zip | |
Added email_rfc_5322 pattern
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_email.py | 41 | ||||
| -rw-r--r-- | tests/test_phone.py | 2 |
2 files changed, 38 insertions, 5 deletions
diff --git a/tests/test_email.py b/tests/test_email.py index 2c90c52..cc28472 100644 --- a/tests/test_email.py +++ b/tests/test_email.py @@ -1,8 +1,7 @@ from edify.library import email +from edify.library import email_rfc_5322 - -def test(): - emails = [ +emails = [ @@ -26,7 +25,11 @@ def test(): "あいうえお@example.com", - ] +] + + +def test_email(): + expectations = [ True, True, @@ -54,3 +57,33 @@ def test(): ] for i in range(len(emails)): assert email(emails[i]) == expectations[i] + + +def test_email_rfc_5322(): + expectations = [ + True, + True, + True, + True, + True, + True, + True, + True, + True, + True, + True, + False, + False, + False, + False, + False, + False, + False, + False, + False, + False, + False, + False + ] + for i in range(len(emails)): + assert email_rfc_5322(emails[i]) == expectations[i] diff --git a/tests/test_phone.py b/tests/test_phone.py index 81168ab..8c95d60 100644 --- a/tests/test_phone.py +++ b/tests/test_phone.py @@ -10,7 +10,7 @@ def test(): "123 456 7890": True, "+1 (123) 456-7890": True, "+1 (123) 456 7890": True, - "+1 (123) 456-7890": True, + "+1-(123)-456-7890": True, "+102 (123) 456-7890": True, "+91 (123) 456-7890": True, "90122121": True, |
