diff --git a/src/tests/test_app.py b/src/tests/test_app.py index 9af20ca..e6bdc6f 100644 --- a/src/tests/test_app.py +++ b/src/tests/test_app.py @@ -5,9 +5,9 @@ class TestApp(unittest.TestCase): def test_app(self): - application = app.get_app() + application = app.app app_client = application.test_client() - intervals = price.cached_intervals + intervals = price.supported_intervals algorithms = utils.get_algorithms() #Test backtest && backtest plot && plot views for algorithm in algorithms: @@ -30,7 +30,6 @@ def test_app(self): #test plot_response plot_response = app_client.get(f'/backtest/{algorithm}?interval={interval}') self.assertEqual(plot_response.status_code, 200) - time.sleep(2) #Test internal checker authorization and results authorization_data = { @@ -43,7 +42,5 @@ def test_app(self): self.assertIn(algorithm, internal_checker_response.json['algorithms']) #Check internal checker response to false - internal_checker_response = app_client.get('/internal_checker', headers={'not_correct': 'not_correct'}) + internal_checker_response = app_client.get('/signals', headers={'not_correct': 'not_correct'}) self.assertEqual(internal_checker_response.status_code, 401) - - time.sleep(2) #Solved to many requests from kraken diff --git a/src/tests/test_backtest.py b/src/tests/test_backtest.py index a3660c8..4a77021 100644 --- a/src/tests/test_backtest.py +++ b/src/tests/test_backtest.py @@ -5,7 +5,7 @@ class TestApp(unittest.TestCase): #Test backtest_module.py, using backtest plot data is because theres no much diffirence (optomization) def test_backtest(self): - prices, timestamps = price.get_prices() + prices, timestamps = price.get_prices(240, 'USDC-WETH') backtest_plot_data = backtest_module.backtest('bollinger_bands', prices, timestamps, plot=True) #Test back test data keys are correct and backtest data exsits backtest_dict = { diff --git a/src/tests/test_price.py b/src/tests/test_price.py index d5e074c..1e573e6 100644 --- a/src/tests/test_price.py +++ b/src/tests/test_price.py @@ -9,4 +9,4 @@ def test_price(self): #Test get default interval using 240 (change if the default interval is changed) self.assertEqual(get_using_interval(), 240) #Test get prices using is not none - self.assertIsNotNone(get_prices()) + self.assertIsNotNone(get_prices(240, 'USDC-WETH'))