aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_phone.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_phone.py b/tests/test_phone.py
new file mode 100644
index 0000000..6a26af5
--- /dev/null
+++ b/tests/test_phone.py
@@ -0,0 +1,24 @@
+from edify.library import phone_number
+
+def test():
+ phones = {
+ "1234567890": True,
+ "123 456 7890": True,
+ "123-456-7890": True,
+ "123.456.7890": True,
+ "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,
+ "12345678901": True,
+ "+1 (124) 232": True,
+ "+1 (123) 45-890": True,
+ "+1 (1) 456-7890": True,
+ "9012": False,
+ "+1 (615) 243-": False
+ }
+ for phone, expectation in phones.items():
+ assert phone_number(phone) == expectation