Rename test-legacy strategy

This commit is contained in:
Matthias 2021-08-26 07:04:33 +02:00
parent 1f3ccc2587
commit fbf8eb4526
7 changed files with 13 additions and 13 deletions

View File

@ -816,7 +816,7 @@ def test_start_list_strategies(mocker, caplog, capsys):
# pargs['config'] = None # pargs['config'] = None
start_list_strategies(pargs) start_list_strategies(pargs)
captured = capsys.readouterr() captured = capsys.readouterr()
assert "TestStrategyLegacy" in captured.out assert "TestStrategyLegacyV1" in captured.out
assert "legacy_strategy.py" not in captured.out assert "legacy_strategy.py" not in captured.out
assert "DefaultStrategy" in captured.out assert "DefaultStrategy" in captured.out
@ -831,7 +831,7 @@ def test_start_list_strategies(mocker, caplog, capsys):
# pargs['config'] = None # pargs['config'] = None
start_list_strategies(pargs) start_list_strategies(pargs)
captured = capsys.readouterr() captured = capsys.readouterr()
assert "TestStrategyLegacy" in captured.out assert "TestStrategyLegacyV1" in captured.out
assert "legacy_strategy.py" in captured.out assert "legacy_strategy.py" in captured.out
assert "DefaultStrategy" in captured.out assert "DefaultStrategy" in captured.out

View File

@ -473,7 +473,7 @@ def test_backtesting_pairlist_list(default_conf, mocker, caplog, testdatadir, ti
Backtesting(default_conf) Backtesting(default_conf)
# Multiple strategies # Multiple strategies
default_conf['strategy_list'] = ['DefaultStrategy', 'TestStrategyLegacy'] default_conf['strategy_list'] = ['DefaultStrategy', 'TestStrategyLegacyV1']
with pytest.raises(OperationalException, with pytest.raises(OperationalException,
match='PrecisionFilter not allowed for backtesting multiple strategies.'): match='PrecisionFilter not allowed for backtesting multiple strategies.'):
Backtesting(default_conf) Backtesting(default_conf)
@ -909,7 +909,7 @@ def test_backtest_start_multi_strat(default_conf, mocker, caplog, testdatadir):
'--disable-max-market-positions', '--disable-max-market-positions',
'--strategy-list', '--strategy-list',
'DefaultStrategy', 'DefaultStrategy',
'TestStrategyLegacy', 'TestStrategyLegacyV1',
] ]
args = get_args(args) args = get_args(args)
start_backtesting(args) start_backtesting(args)
@ -932,7 +932,7 @@ def test_backtest_start_multi_strat(default_conf, mocker, caplog, testdatadir):
'up to 2017-11-14 22:58:00 (0 days).', 'up to 2017-11-14 22:58:00 (0 days).',
'Parameter --enable-position-stacking detected ...', 'Parameter --enable-position-stacking detected ...',
'Running backtesting for Strategy DefaultStrategy', 'Running backtesting for Strategy DefaultStrategy',
'Running backtesting for Strategy TestStrategyLegacy', 'Running backtesting for Strategy TestStrategyLegacyV1',
] ]
for line in exists: for line in exists:
@ -1013,7 +1013,7 @@ def test_backtest_start_multi_strat_nomock(default_conf, mocker, caplog, testdat
'--disable-max-market-positions', '--disable-max-market-positions',
'--strategy-list', '--strategy-list',
'DefaultStrategy', 'DefaultStrategy',
'TestStrategyLegacy', 'TestStrategyLegacyV1',
] ]
args = get_args(args) args = get_args(args)
start_backtesting(args) start_backtesting(args)
@ -1030,7 +1030,7 @@ def test_backtest_start_multi_strat_nomock(default_conf, mocker, caplog, testdat
'up to 2017-11-14 22:58:00 (0 days).', 'up to 2017-11-14 22:58:00 (0 days).',
'Parameter --enable-position-stacking detected ...', 'Parameter --enable-position-stacking detected ...',
'Running backtesting for Strategy DefaultStrategy', 'Running backtesting for Strategy DefaultStrategy',
'Running backtesting for Strategy TestStrategyLegacy', 'Running backtesting for Strategy TestStrategyLegacyV1',
] ]
for line in exists: for line in exists:

View File

@ -1219,7 +1219,7 @@ def test_api_strategies(botclient):
assert rc.json() == {'strategies': [ assert rc.json() == {'strategies': [
'DefaultStrategy', 'DefaultStrategy',
'HyperoptableStrategy', 'HyperoptableStrategy',
'TestStrategyLegacy' 'TestStrategyLegacyV1'
]} ]}

View File

@ -5,5 +5,5 @@ import nonexiting_module # noqa
from freqtrade.strategy.interface import IStrategy from freqtrade.strategy.interface import IStrategy
class TestStrategyLegacy(IStrategy): class TestStrategyLegacyV1(IStrategy):
pass pass

View File

@ -10,7 +10,7 @@ from freqtrade.strategy.interface import IStrategy
# -------------------------------- # --------------------------------
# This class is a sample. Feel free to customize it. # This class is a sample. Feel free to customize it.
class TestStrategyLegacy(IStrategy): class TestStrategyLegacyV1(IStrategy):
""" """
This is a test strategy using the legacy function headers, which will be This is a test strategy using the legacy function headers, which will be
removed in a future update. removed in a future update.

View File

@ -603,7 +603,7 @@ def test_is_pair_locked(default_conf):
def test_is_informative_pairs_callback(default_conf): def test_is_informative_pairs_callback(default_conf):
default_conf.update({'strategy': 'TestStrategyLegacy'}) default_conf.update({'strategy': 'TestStrategyLegacyV1'})
strategy = StrategyResolver.load_strategy(default_conf) strategy = StrategyResolver.load_strategy(default_conf)
# Should return empty # Should return empty
# Uses fallback to base implementation # Uses fallback to base implementation

View File

@ -330,7 +330,7 @@ def test_strategy_override_use_sell_profit_only(caplog, default_conf):
@pytest.mark.filterwarnings("ignore:deprecated") @pytest.mark.filterwarnings("ignore:deprecated")
def test_deprecate_populate_indicators(result, default_conf): def test_deprecate_populate_indicators(result, default_conf):
default_location = Path(__file__).parent / "strats" default_location = Path(__file__).parent / "strats"
default_conf.update({'strategy': 'TestStrategyLegacy', default_conf.update({'strategy': 'TestStrategyLegacyV1',
'strategy_path': default_location}) 'strategy_path': default_location})
strategy = StrategyResolver.load_strategy(default_conf) strategy = StrategyResolver.load_strategy(default_conf)
with warnings.catch_warnings(record=True) as w: with warnings.catch_warnings(record=True) as w:
@ -365,7 +365,7 @@ def test_deprecate_populate_indicators(result, default_conf):
def test_call_deprecated_function(result, monkeypatch, default_conf, caplog): 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'] del default_conf['timeframe']
default_conf.update({'strategy': 'TestStrategyLegacy', default_conf.update({'strategy': 'TestStrategyLegacyV1',
'strategy_path': default_location}) 'strategy_path': default_location})
strategy = StrategyResolver.load_strategy(default_conf) strategy = StrategyResolver.load_strategy(default_conf)
metadata = {'pair': 'ETH/BTC'} metadata = {'pair': 'ETH/BTC'}