aboutsummaryrefslogtreecommitdiff
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
parentc58d8510a775a2db622400b4d25c6e4170e69da6 (diff)
downloadedify-194f669897b4b242c2996bed375352abdbefaa31.tar.xz
edify-194f669897b4b242c2996bed375352abdbefaa31.zip
Added Tests for Validating Emails
-rw-r--r--tests/test_edify.py5
-rw-r--r--tests/test_email.py56
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 = [
+ "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]