__author__ = "Florian Kaiser"
__copyright__ = "Copyright 2022, Project Aktienbot"
__credits__ = ["Florian Kaiser", "Florian Kellermann", "Linus Eickhof", "Kevin Pauer"]
__license__ = "GPL 3.0"
__version__ = "1.0.0"

"""
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