diff --git a/freqtrade/tests/conftest.py b/freqtrade/tests/conftest.py index 860f68bdc..e564ed6eb 100644 --- a/freqtrade/tests/conftest.py +++ b/freqtrade/tests/conftest.py @@ -195,6 +195,7 @@ def ticker_history(): "C": 8.88e-05, "V": 991.09056638, "T": "2017-11-26T08:50:00", + "BV": 0.0877869 }, { "O": 8.88e-05, @@ -203,6 +204,7 @@ def ticker_history(): "C": 8.893e-05, "V": 658.77935965, "T": "2017-11-26T08:55:00", + "BV": 0.05874751 }, { "O": 8.891e-05, @@ -211,5 +213,36 @@ def ticker_history(): "C": 8.877e-05, "V": 7920.73570705, "T": "2017-11-26T09:00:00", + "BV": 0.7039405 + } + ] + + +@pytest.fixture +def ticker_history_without_bv(): + return [ + { + "O": 8.794e-05, + "H": 8.948e-05, + "L": 8.794e-05, + "C": 8.88e-05, + "V": 991.09056638, + "T": "2017-11-26T08:50:00" + }, + { + "O": 8.88e-05, + "H": 8.942e-05, + "L": 8.88e-05, + "C": 8.893e-05, + "V": 658.77935965, + "T": "2017-11-26T08:55:00" + }, + { + "O": 8.891e-05, + "H": 8.893e-05, + "L": 8.875e-05, + "C": 8.877e-05, + "V": 7920.73570705, + "T": "2017-11-26T09:00:00" } ] diff --git a/freqtrade/tests/test_analyze.py b/freqtrade/tests/test_analyze.py index b8cd2f6e3..5653b0d5a 100644 --- a/freqtrade/tests/test_analyze.py +++ b/freqtrade/tests/test_analyze.py @@ -72,3 +72,16 @@ def test_get_signal_handles_exceptions(mocker): side_effect=Exception('invalid ticker history ')) assert get_signal('BTC-ETH') == (False, False) + + +def test_parse_ticker_dataframe(ticker_history, ticker_history_without_bv): + + columns = ['close', 'high', 'low', 'open', 'date', 'volume'] + + # Test file with BV data + dataframe = parse_ticker_dataframe(ticker_history) + assert dataframe.columns.tolist() == columns + + # Test file without BV data + dataframe = parse_ticker_dataframe(ticker_history_without_bv) + assert dataframe.columns.tolist() == columns