2022-04-12 07:50:24 +00:00
|
|
|
__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"
|
|
|
|
|
2022-03-30 08:46:54 +00:00
|
|
|
"""
|
|
|
|
This file (test_transaction.py) contains the unit tests for the blueprints/transaction.py file.
|
|
|
|
"""
|
|
|
|
from app.blueprints.transactions import *
|
|
|
|
|
|
|
|
|
|
|
|
def test_check_if_symbol_data_exists():
|
|
|
|
"""
|
|
|
|
Test check_if_symbol_data_exists function
|
|
|
|
"""
|
|
|
|
assert check_if_symbol_data_exists(dict(symbol='DTEGY')) is True
|
|
|
|
assert check_if_symbol_data_exists(dict(symbol='')) is False
|
|
|
|
assert check_if_symbol_data_exists(dict()) is False
|
|
|
|
|
|
|
|
|
|
|
|
def test_check_if_time_data_exists():
|
|
|
|
"""
|
|
|
|
Test check_if_time_data_exists function
|
|
|
|
"""
|
|
|
|
assert check_if_time_data_exists(dict(time='2022-03-29T10:00:00.000Z')) is True
|
|
|
|
assert check_if_time_data_exists(dict(time='')) is False
|
|
|
|
assert check_if_time_data_exists(dict()) is False
|
|
|
|
|
|
|
|
|
|
|
|
def test_check_if_count_data_exists():
|
|
|
|
"""
|
|
|
|
Test check_if_count_data_exists function
|
|
|
|
"""
|
|
|
|
assert check_if_count_data_exists(dict(count=10)) is True
|
|
|
|
assert check_if_count_data_exists(dict(count=None)) is False
|
|
|
|
assert check_if_count_data_exists(dict()) is False
|
|
|
|
|
|
|
|
|
|
|
|
def test_check_if_price_data_exists():
|
|
|
|
"""
|
|
|
|
Test check_if_price_data_exists function
|
|
|
|
"""
|
|
|
|
assert check_if_price_data_exists(dict(price=9.99)) is True
|
|
|
|
assert check_if_price_data_exists(dict(price=None)) is False
|
|
|
|
assert check_if_price_data_exists(dict()) is False
|