aboutsummaryrefslogtreecommitdiff
path: root/tests/test_email.py
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-08-30 23:06:15 -0400
committerBobby <[email protected]>2022-08-30 23:06:15 -0400
commit194f669897b4b242c2996bed375352abdbefaa31 (patch)
tree54daa4dfc7ff9fd181a7d677331c27f5be0307c3 /tests/test_email.py
parentc58d8510a775a2db622400b4d25c6e4170e69da6 (diff)
downloadedify-194f669897b4b242c2996bed375352abdbefaa31.tar.xz
edify-194f669897b4b242c2996bed375352abdbefaa31.zip
Added Tests for Validating Emails
Diffstat (limited to 'tests/test_email.py')
-rw-r--r--tests/test_email.py56
1 files changed, 56 insertions, 0 deletions
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 = [
+ "plainaddress",
+ "#@%^%#$@#$@#.com",
+ "@example.com",
+ "Joe Smith <[email protected]>",
+ "email.example.com",
+ "あいうえお@example.com",
+ ]
+ 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]