about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--wqflask/tests/wqflask/test_user_login.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/wqflask/tests/wqflask/test_user_login.py b/wqflask/tests/wqflask/test_user_login.py
new file mode 100644
index 00000000..61cd9ab9
--- /dev/null
+++ b/wqflask/tests/wqflask/test_user_login.py
@@ -0,0 +1,21 @@
+"""Test cases for some methods in login.py"""
+
+import unittest
+from wqflask.user_login import encode_password
+
+
+class TestUserLogin(unittest.TestCase):
+    def test_encode_password(self):
+        """
+        Test encode password
+        """
+        pass_gen_fields = {
+            "salt": "salt",
+            "hashfunc": "sha1",
+            "iterations": 4096,
+            "keylength": 20,
+        }
+        self.assertEqual(
+            encode_password(pass_gen_fields,
+                            "password").get("password"),
+            '4b007901b765489abead49d926f721d065a429c1')