Don't actually load models to avoid random failures

This commit is contained in:
Matthias 2022-12-23 16:19:12 +01:00
parent 73792fd6ce
commit 524da3c7ab

View File

@ -1488,19 +1488,30 @@ def test_api_strategy(botclient):
assert_response(rc, 500)
def test_api_freqaimodels(botclient, tmpdir):
def test_api_freqaimodels(botclient, tmpdir, mocker):
ftbot, client = botclient
ftbot.config['user_data_dir'] = Path(tmpdir)
mocker.patch(
"freqtrade.resolvers.freqaimodel_resolver.FreqaiModelResolver.search_all_objects",
return_value=[
{'name': 'LightGBMClassifier'},
{'name': 'LightGBMClassifierMultiTarget'},
{'name': 'LightGBMRegressor'},
{'name': 'LightGBMRegressorMultiTarget'},
{'name': 'ReinforcementLearner'},
{'name': 'ReinforcementLearner_multiproc'},
{'name': 'XGBoostClassifier'},
{'name': 'XGBoostRFClassifier'},
{'name': 'XGBoostRFRegressor'},
{'name': 'XGBoostRegressor'},
{'name': 'XGBoostRegressorMultiTarget'},
])
rc = client_get(client, f"{BASE_URI}/freqaimodels")
assert_response(rc)
assert rc.json() == {'freqaimodels': [
'CatboostClassifier',
'CatboostClassifierMultiTarget',
'CatboostRegressor',
'CatboostRegressorMultiTarget',
'LightGBMClassifier',
'LightGBMClassifierMultiTarget',
'LightGBMRegressor',