add test for load

This commit is contained in:
Levi Blaney
2021-03-01 02:24:01 -05:00
parent 0b9f948d77
commit 76d94b9dff
3 changed files with 23 additions and 0 deletions

0
tests/__init__.py Normal file
View File

2
tests/conftest.py Normal file
View File

@@ -0,0 +1,2 @@
def pytest_configure(config):
config.addinivalue_line("markers", "e2e: mark as end-to-end test.")

View File

@@ -0,0 +1,21 @@
from unittest.mock import patch
import pandas as pd
import pytest
from gamestonk_terminal import load
@pytest.mark.e2e
def test_load_command():
test_stock = 'TSLA'
test_start = '2020-06-04'
with patch('sys.stdout.write') as mock_out:
result = load(['-t', test_stock, '-s', test_start], '', '', '', '')
args = mock_out.call_args_list[0][0]
assert result[0] == test_stock
assert test_stock in args[0]
assert test_start in args[0]