chore: adjust backtest-optimize reports tests
This commit is contained in:
@@ -236,7 +236,7 @@ def test_generate_backtest_stats(default_conf, testdatadir, tmp_path):
|
|||||||
filename_last = tmp_path / LAST_BT_RESULT_FN
|
filename_last = tmp_path / LAST_BT_RESULT_FN
|
||||||
_backup_file(filename_last, copy_file=True)
|
_backup_file(filename_last, copy_file=True)
|
||||||
assert not filename.is_file()
|
assert not filename.is_file()
|
||||||
default_conf["exportfilename"] = filename
|
default_conf["exportdirectory"] = filename
|
||||||
|
|
||||||
store_backtest_results(default_conf, stats, "2022_01_01_15_05_13")
|
store_backtest_results(default_conf, stats, "2022_01_01_15_05_13")
|
||||||
|
|
||||||
@@ -263,7 +263,7 @@ def test_store_backtest_results(testdatadir, mocker):
|
|||||||
zip_mock = mocker.patch("freqtrade.optimize.optimize_reports.bt_storage.ZipFile")
|
zip_mock = mocker.patch("freqtrade.optimize.optimize_reports.bt_storage.ZipFile")
|
||||||
data = {"metadata": {}, "strategy": {}, "strategy_comparison": []}
|
data = {"metadata": {}, "strategy": {}, "strategy_comparison": []}
|
||||||
store_backtest_results(
|
store_backtest_results(
|
||||||
{"exportfilename": testdatadir, "original_config": {}}, data, "2022_01_01_15_05_13"
|
{"exportdirectory": testdatadir, "original_config": {}}, data, "2022_01_01_15_05_13"
|
||||||
)
|
)
|
||||||
|
|
||||||
assert dump_mock.call_count == 2
|
assert dump_mock.call_count == 2
|
||||||
@@ -275,7 +275,7 @@ def test_store_backtest_results(testdatadir, mocker):
|
|||||||
zip_mock.reset_mock()
|
zip_mock.reset_mock()
|
||||||
filename = testdatadir / "testresult.json"
|
filename = testdatadir / "testresult.json"
|
||||||
store_backtest_results(
|
store_backtest_results(
|
||||||
{"exportfilename": filename, "original_config": {}}, data, "2022_01_01_15_05_13"
|
{"exportdirectory": filename, "original_config": {}}, data, "2022_01_01_15_05_13"
|
||||||
)
|
)
|
||||||
assert dump_mock.call_count == 2
|
assert dump_mock.call_count == 2
|
||||||
assert zip_mock.call_count == 1
|
assert zip_mock.call_count == 1
|
||||||
@@ -287,7 +287,7 @@ def test_store_backtest_results(testdatadir, mocker):
|
|||||||
def test_store_backtest_results_real(tmp_path, caplog):
|
def test_store_backtest_results_real(tmp_path, caplog):
|
||||||
data = {"metadata": {}, "strategy": {}, "strategy_comparison": []}
|
data = {"metadata": {}, "strategy": {}, "strategy_comparison": []}
|
||||||
config = {
|
config = {
|
||||||
"exportfilename": tmp_path,
|
"exportdirectory": tmp_path,
|
||||||
"original_config": {},
|
"original_config": {},
|
||||||
}
|
}
|
||||||
store_backtest_results(
|
store_backtest_results(
|
||||||
@@ -356,7 +356,7 @@ def test_write_read_backtest_candles(tmp_path):
|
|||||||
bt_results = {"metadata": {}, "strategy": {}, "strategy_comparison": []}
|
bt_results = {"metadata": {}, "strategy": {}, "strategy_comparison": []}
|
||||||
|
|
||||||
mock_conf = {
|
mock_conf = {
|
||||||
"exportfilename": tmp_path,
|
"exportdirectory": tmp_path,
|
||||||
"export": "signals",
|
"export": "signals",
|
||||||
"runmode": "backtest",
|
"runmode": "backtest",
|
||||||
"original_config": {},
|
"original_config": {},
|
||||||
|
|||||||
Reference in New Issue
Block a user