diff options
| author | Bobby <[email protected]> | 2022-08-30 23:06:15 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-08-30 23:06:15 -0400 |
| commit | 194f669897b4b242c2996bed375352abdbefaa31 (patch) | |
| tree | 54daa4dfc7ff9fd181a7d677331c27f5be0307c3 /tests | |
| parent | c58d8510a775a2db622400b4d25c6e4170e69da6 (diff) | |
| download | edify-194f669897b4b242c2996bed375352abdbefaa31.tar.xz edify-194f669897b4b242c2996bed375352abdbefaa31.zip | |
Added Tests for Validating Emails
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_edify.py | 5 | ||||
| -rw-r--r-- | tests/test_email.py | 56 |
2 files changed, 56 insertions, 5 deletions
diff --git a/tests/test_edify.py b/tests/test_edify.py deleted file mode 100644 index bb81dbc..0000000 --- a/tests/test_edify.py +++ /dev/null @@ -1,5 +0,0 @@ -from edify.main import main - - -def test_main(): - assert main() == 0 diff --git a/tests/test_email.py b/tests/test_email.py new file mode 100644 index 0000000..2c90c52 --- /dev/null +++ b/tests/test_email.py @@ -0,0 +1,56 @@ +from edify.library import email + + +def test(): + emails = [ + "[email protected]", + "[email protected]", + "[email protected]", + "[email protected]", + "[email protected]", + "[email protected]", + "[email protected]", + "[email protected]", + "[email protected]", + "[email protected]", + "[email protected].", + "plainaddress", + "#@%^%#$@#$@#.com", + "@example.com", + "Joe Smith <[email protected]>", + "email.example.com", + "email@[email protected]", + "[email protected]", + "[email protected]", + "[email protected]", + "あいうえお@example.com", + "[email protected]", + ] + expectations = [ + True, + True, + True, + True, + True, + True, + True, + True, + True, + True, + False, + False, + False, + False, + False, + False, + False, + False, + False, + False, + False, + False, + False + ] + for i in range(len(emails)): + assert email(emails[i]) == expectations[i] |
