From 5d06524c8465064248cc3605c69dd32687ea7565 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 20 Oct 2020 22:55:19 +0300 Subject: Add tests for encoding password * wqflask/tests/wqflask/test_user_login.py: New tests. --- wqflask/tests/wqflask/test_user_login.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 wqflask/tests/wqflask/test_user_login.py 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') -- cgit v1.2.3