Test populate_any_indicator interface

This commit is contained in:
Matthias 2022-08-13 09:48:59 +02:00
parent 3918f4abbd
commit c190d57f1a

View File

@ -290,6 +290,18 @@ def test_advise_all_indicators(default_conf, testdatadir) -> None:
assert len(processed['UNITTEST/BTC']) == 102 # partial candle was removed assert len(processed['UNITTEST/BTC']) == 102 # partial candle was removed
def test_populate_any_indicators(default_conf, testdatadir) -> None:
strategy = StrategyResolver.load_strategy(default_conf)
timerange = TimeRange.parse_timerange('1510694220-1510700340')
data = load_data(testdatadir, '1m', ['UNITTEST/BTC'], timerange=timerange,
fill_up_missing=True)
processed = strategy.populate_any_indicators('UNITTEST/BTC', data, '5m')
assert processed == data
assert id(processed) == id(data)
assert len(processed['UNITTEST/BTC']) == 102 # partial candle was removed
def test_advise_all_indicators_copy(mocker, default_conf, testdatadir) -> None: def test_advise_all_indicators_copy(mocker, default_conf, testdatadir) -> None:
strategy = StrategyResolver.load_strategy(default_conf) strategy = StrategyResolver.load_strategy(default_conf)
aimock = mocker.patch('freqtrade.strategy.interface.IStrategy.advise_indicators') aimock = mocker.patch('freqtrade.strategy.interface.IStrategy.advise_indicators')