Terarea  2
The automation project
Loading...
Searching...
No Matches
test_password_handling.py
Go to the documentation of this file.
1"""_summary_
2 File in charge of testing the http response codes.
3"""
4import os
5import sys
6
7sys.path.append(os.getcwd())
8try:
9 from src.lib.components.password_handling import PasswordHandling
10except ImportError as e:
11 raise ImportError("Failed to import the src module") from e
12
13DUMMY_PASSWORD = "some_password"
14WRONG_PASSWORD = "some_other_password"
16HASHED_PASSWORD = PHI.hash_password(DUMMY_PASSWORD)
17
18
20 """_summary_
21 Function in charge of testing if the current password is the same as the hashed version.
22 """
23 assert PHI.check_password(DUMMY_PASSWORD, HASHED_PASSWORD) is True
24
25
26def test_wrong_password() -> None:
27 """_summary_
28 Function in charge of testing if the current password is not the same as the hashed version.
29 """
30 assert PHI.check_password(WRONG_PASSWORD, HASHED_PASSWORD) is False