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
"""
4
import
os
5
import
sys
6
7
sys.path.append(os.getcwd())
8
try
:
9
from
src.lib.components.password_handling
import
PasswordHandling
10
except
ImportError
as
e:
11
raise
ImportError(
"Failed to import the src module"
)
from
e
12
13
DUMMY_PASSWORD =
"some_password"
14
WRONG_PASSWORD =
"some_other_password"
15
PHI =
PasswordHandling
()
16
HASHED_PASSWORD = PHI.hash_password(DUMMY_PASSWORD)
17
18
19
def
test_correct_password
() -> None:
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
26
def
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
src.lib.components.password_handling.PasswordHandling
Definition
password_handling.py:8
src.lib.components.password_handling
Definition
password_handling.py:1
test_password_handling.test_wrong_password
None test_wrong_password()
Definition
test_password_handling.py:26
test_password_handling.test_correct_password
None test_correct_password()
Definition
test_password_handling.py:19
app
back
server
tests
test_password_handling.py
Generated on Sat Feb 22 2025 14:36:42 for Terarea by
1.12.0