aboutsummaryrefslogtreecommitdiff
path: root/gn2/tests/unit/wqflask/test_user_login.py
blob: 84e25d45e4a02f1809feda7ae4e1bc82e30d91f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""Test cases for some methods in login.py"""

import unittest
from gn2.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')