Add test case for strategy overwriting

This commit is contained in:
Matthias 2020-06-02 13:08:21 +02:00
parent a8005819c9
commit b106c88630

View File

@ -358,8 +358,9 @@ def test_deprecate_populate_indicators(result, default_conf):
@pytest.mark.filterwarnings("ignore:deprecated") @pytest.mark.filterwarnings("ignore:deprecated")
def test_call_deprecated_function(result, monkeypatch, default_conf): def test_call_deprecated_function(result, monkeypatch, default_conf, caplog):
default_location = Path(__file__).parent / "strats" default_location = Path(__file__).parent / "strats"
del default_conf['timeframe']
default_conf.update({'strategy': 'TestStrategyLegacy', default_conf.update({'strategy': 'TestStrategyLegacy',
'strategy_path': default_location}) 'strategy_path': default_location})
strategy = StrategyResolver.load_strategy(default_conf) strategy = StrategyResolver.load_strategy(default_conf)
@ -385,6 +386,9 @@ def test_call_deprecated_function(result, monkeypatch, default_conf):
assert isinstance(selldf, DataFrame) assert isinstance(selldf, DataFrame)
assert 'sell' in selldf assert 'sell' in selldf
assert log_has('DEPRECATED: Please migrate to using timeframe instead of ticker_interval.',
caplog)
def test_strategy_interface_versioning(result, monkeypatch, default_conf): def test_strategy_interface_versioning(result, monkeypatch, default_conf):
default_conf.update({'strategy': 'DefaultStrategy'}) default_conf.update({'strategy': 'DefaultStrategy'})