add test for metric tracker

This commit is contained in:
robcaulk 2022-10-11 19:24:47 +02:00
parent 76b33359a9
commit 88b8f18639

View File

@ -56,9 +56,15 @@ def test_extract_data_and_train_model_Standard(mocker, freqai_conf, model):
data_load_timerange = TimeRange.parse_timerange("20180125-20180130") data_load_timerange = TimeRange.parse_timerange("20180125-20180130")
new_timerange = TimeRange.parse_timerange("20180127-20180130") new_timerange = TimeRange.parse_timerange("20180127-20180130")
freqai.train_timer("start", "ADA/BTC")
freqai.extract_data_and_train_model( freqai.extract_data_and_train_model(
new_timerange, "ADA/BTC", strategy, freqai.dk, data_load_timerange) new_timerange, "ADA/BTC", strategy, freqai.dk, data_load_timerange)
freqai.train_timer("stop", "ADA/BTC")
freqai.dd.save_metric_tracker_to_disk()
freqai.dd.save_drawer_to_disk()
assert Path(freqai.dk.full_path / "metric_tracker.json").is_file()
assert Path(freqai.dk.full_path / "pair_dictionary.json").is_file()
assert Path(freqai.dk.data_path / assert Path(freqai.dk.data_path /
f"{freqai.dk.model_filename}_model.{model_save_ext}").is_file() f"{freqai.dk.model_filename}_model.{model_save_ext}").is_file()
assert Path(freqai.dk.data_path / f"{freqai.dk.model_filename}_metadata.json").is_file() assert Path(freqai.dk.data_path / f"{freqai.dk.model_filename}_metadata.json").is_file()