aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-11-27 16:03:39 -0500
committerBobby <[email protected]>2022-11-27 16:03:39 -0500
commit1ed7e8bac832d4f8de8a320d581372038f7011d4 (patch)
tree3ad342783ae289aaa5fcb6b86d424884e20495a1 /tests
parentd02c725d5d5a6bbeb42cf703a4ac2116e2c45f2d (diff)
downloadedify-1ed7e8bac832d4f8de8a320d581372038f7011d4.tar.xz
edify-1ed7e8bac832d4f8de8a320d581372038f7011d4.zip
added password validator
Diffstat (limited to 'tests')
-rw-r--r--tests/test_password.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_password.py b/tests/test_password.py
new file mode 100644
index 0000000..b4fc7fb
--- /dev/null
+++ b/tests/test_password.py
@@ -0,0 +1,9 @@
+from edify.library import password
+
+def test_password():
+ assert password("password") == False
+ assert password("Password123!") == True
+ assert password("Password123!", max_length=8) == False
+ assert password("Password123!", min_upper=2) == False
+ assert password("password", min_upper=0, min_digit=0, min_special=0) == True
+ assert password("pass@#1", min_special=1, special_chars="!", min_digit=0, min_upper=0, min_length=4) == False