- Improved directory structure
- Added functional and unit tests
This commit is contained in:
2022-03-30 10:46:54 +02:00
parent e27e2175b5
commit 21d2bc334c
33 changed files with 1782 additions and 238 deletions

View File

@@ -0,0 +1,40 @@
"""
This file (test_helper_functions.py) contains the unit tests for the helper_functions.py file.
"""
from app.blueprints.user import *
def test_check_if_email_data_exists():
"""
Test check_if_email_data_exists function
"""
assert check_if_email_data_exists(dict(email='user@example.com')) is True
assert check_if_email_data_exists(dict(email='')) is False
assert check_if_email_data_exists(dict()) is False
def test_check_if_password_data_exists():
"""
Test check_if_password_data_exists function
"""
assert check_if_password_data_exists(dict(password='password')) is True
assert check_if_password_data_exists(dict(password='')) is False
assert check_if_password_data_exists(dict()) is False
def test_check_if_username_data_exists():
"""
Test check_if_username_data_exists function
"""
assert check_if_username_data_exists(dict(username='user')) is True
assert check_if_username_data_exists(dict(username='')) is False
assert check_if_username_data_exists(dict()) is False
def test_check_if_admin_data_exists():
"""
Test check_if_admin_data_exists function
"""
assert check_if_admin_data_exists(dict(admin=True)) is True
assert check_if_admin_data_exists(dict(admin=None)) is False
assert check_if_admin_data_exists(dict()) is False