From fc6e1104311818011de7b80ee74e199ccf45be60 Mon Sep 17 00:00:00 2001 From: Levi Blaney Date: Mon, 1 Mar 2021 03:29:43 -0500 Subject: [PATCH] add neural network test --- .../test_neural_networks.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/test_prediction_techniques/test_neural_networks.py diff --git a/tests/test_prediction_techniques/test_neural_networks.py b/tests/test_prediction_techniques/test_neural_networks.py new file mode 100644 index 00000000000..a7daaef098d --- /dev/null +++ b/tests/test_prediction_techniques/test_neural_networks.py @@ -0,0 +1,25 @@ +from unittest.mock import patch + +import pytest + +from prediction_techniques.neural_networks import mlp +from gamestonk_terminal import load + + +@pytest.fixture +def stock(): + + def load_stock(name, start='2020-06-04'): + return load(['-t', name, '-s', start], '', '', '', '') + + return load_stock + + +@pytest.mark.e2e +def test_mlp(stock): + + with patch('sys.stdout.write') as mock_out: + tesla = stock('TSLA') + mlp([], tesla[0], tesla[2], tesla[3]) + + mock_out.assert_any_call('Predicted share price:')