diff options
| -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] |
