Fix tests that failed due to new strategy.

This commit is contained in:
Evgeniy Vladimirov 2022-10-16 14:59:55 +03:00
parent de9f5660f3
commit 82d75d8914
2 changed files with 5 additions and 3 deletions

View File

@ -1457,6 +1457,7 @@ def test_api_strategies(botclient, tmpdir):
'InformativeDecoratorTest', 'InformativeDecoratorTest',
'StrategyTestV2', 'StrategyTestV2',
'StrategyTestV3', 'StrategyTestV3',
'StrategyTestV3CustomEntryPrice',
'StrategyTestV3Futures', 'StrategyTestV3Futures',
'freqai_test_classifier', 'freqai_test_classifier',
'freqai_test_multimodel_strat', 'freqai_test_multimodel_strat',

View File

@ -34,7 +34,7 @@ def test_search_all_strategies_no_failed():
directory = Path(__file__).parent / "strats" directory = Path(__file__).parent / "strats"
strategies = StrategyResolver._search_all_objects(directory, enum_failed=False) strategies = StrategyResolver._search_all_objects(directory, enum_failed=False)
assert isinstance(strategies, list) assert isinstance(strategies, list)
assert len(strategies) == 9 assert len(strategies) == 10
assert isinstance(strategies[0], dict) assert isinstance(strategies[0], dict)
@ -42,10 +42,11 @@ def test_search_all_strategies_with_failed():
directory = Path(__file__).parent / "strats" directory = Path(__file__).parent / "strats"
strategies = StrategyResolver._search_all_objects(directory, enum_failed=True) strategies = StrategyResolver._search_all_objects(directory, enum_failed=True)
assert isinstance(strategies, list) assert isinstance(strategies, list)
assert len(strategies) == 10 assert len(strategies) == 11
# with enum_failed=True search_all_objects() shall find 2 good strategies # with enum_failed=True search_all_objects() shall find 2 good strategies
# and 1 which fails to load # and 1 which fails to load
assert len([x for x in strategies if x['class'] is not None]) == 9 assert len([x for x in strategies if x['class'] is not None]) == 10
assert len([x for x in strategies if x['class'] is None]) == 1 assert len([x for x in strategies if x['class'] is None]) == 1
directory = Path(__file__).parent / "strats_nonexistingdir" directory = Path(__file__).parent / "strats_nonexistingdir"