aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-11-27 16:14:33 -0500
committerBobby <[email protected]>2022-11-27 16:14:33 -0500
commitb245307f903d8eee53e880c3d68b77ee32d07003 (patch)
tree2153488f311fcc9f34282161380e6cfacd2d8b9f /tests
parent1ed7e8bac832d4f8de8a320d581372038f7011d4 (diff)
downloadedify-b245307f903d8eee53e880c3d68b77ee32d07003.tar.xz
edify-b245307f903d8eee53e880c3d68b77ee32d07003.zip
added ssn and mac validators
Diffstat (limited to 'tests')
-rw-r--r--tests/ssn_test.py11
-rw-r--r--tests/test_mac.py11
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/ssn_test.py b/tests/ssn_test.py
new file mode 100644
index 0000000..8317ec0
--- /dev/null
+++ b/tests/ssn_test.py
@@ -0,0 +1,11 @@
+from edify.library import ssn
+
+def test_ssn():
+ ssns = {
+ "000-22-3333": False,
+ "100-22-3333": True,
+ "": False,
+ 123: False,
+ }
+ for s_s_n, expected in ssns.items():
+ assert ssn(s_s_n) == expected
diff --git a/tests/test_mac.py b/tests/test_mac.py
new file mode 100644
index 0000000..636b649
--- /dev/null
+++ b/tests/test_mac.py
@@ -0,0 +1,11 @@
+from edify.library import mac
+
+def test_mac():
+ macs = {
+ "00:00:5e:00:53:af": True,
+ "00:00:5e:00:53:af:": False,
+ 123: False,
+ }
+
+ for m_a_c, expected in macs.items():
+ assert mac(m_a_c) == expected