aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBonfaceKilz2020-10-20 22:55:19 +0300
committerBonfaceKilz2020-10-20 22:55:19 +0300
commit5d06524c8465064248cc3605c69dd32687ea7565 (patch)
treefa15a460776dab191fe94818d7a8455dc4bab7c2
parentd08d2322c5f88752ff062569ce6110cbc3815b62 (diff)
downloadgenenetwork2-5d06524c8465064248cc3605c69dd32687ea7565.tar.gz
Add tests for encoding password
* wqflask/tests/wqflask/test_user_login.py: New tests.
-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')