From 76d94b9dff97a98b9da54dcd00e6dfa84a476379 Mon Sep 17 00:00:00 2001 From: Levi Blaney Date: Mon, 1 Mar 2021 02:24:01 -0500 Subject: [PATCH] add test for load --- tests/__init__.py | 0 tests/conftest.py | 2 ++ tests/test_gamestonk_terminal.py | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 tests/__init__.py create mode 100644 tests/conftest.py create mode 100644 tests/test_gamestonk_terminal.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 00000000000..ca073aeb742 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,2 @@ +def pytest_configure(config): + config.addinivalue_line("markers", "e2e: mark as end-to-end test.") \ No newline at end of file diff --git a/tests/test_gamestonk_terminal.py b/tests/test_gamestonk_terminal.py new file mode 100644 index 00000000000..d45d4ffdfe8 --- /dev/null +++ b/tests/test_gamestonk_terminal.py @@ -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]