mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-29 05:21:48 +00:00
add test for load
This commit is contained in:
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
2
tests/conftest.py
Normal file
2
tests/conftest.py
Normal file
@@ -0,0 +1,2 @@
|
||||
def pytest_configure(config):
|
||||
config.addinivalue_line("markers", "e2e: mark as end-to-end test.")
|
||||
21
tests/test_gamestonk_terminal.py
Normal file
21
tests/test_gamestonk_terminal.py
Normal 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]
|
||||
Reference in New Issue
Block a user