TelegramAktienBot/api/tests/unit/test_helper_functions.py

28 lines
665 B
Python

"""
This file (test_helper_functions.py) contains the unit tests for the helper_functions.py file.
"""
from app.helper_functions import *
def test_hash_password():
"""
Test hash_password function
"""
assert hash_password("password") != "password"
def test_check_password():
"""
Test check_password function
"""
hashed = hash_password("password")
assert check_password(hashed, "password".encode("utf-8")) is True
assert check_password(hashed, "password1".encode("utf-8")) is False
def test_get_email_from_token():
"""
Test get_email_from_token function
"""
assert get_email_from_token_data(None) is None