mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Improve backtest_stats storing test
This commit is contained in:
parent
1a1103c239
commit
1926e642cd
|
@ -213,7 +213,8 @@ def test_store_backtest_stats(testdatadir, mocker):
|
|||
|
||||
dump_mock = mocker.patch('freqtrade.optimize.optimize_reports.bt_storage.file_dump_json')
|
||||
|
||||
store_backtest_stats(testdatadir, {'metadata': {}}, '2022_01_01_15_05_13')
|
||||
data = {'metadata': {}, 'strategy': {}, 'strategy_comparison': []}
|
||||
store_backtest_stats(testdatadir, data, '2022_01_01_15_05_13')
|
||||
|
||||
assert dump_mock.call_count == 3
|
||||
assert isinstance(dump_mock.call_args_list[0][0][0], Path)
|
||||
|
@ -221,7 +222,7 @@ def test_store_backtest_stats(testdatadir, mocker):
|
|||
|
||||
dump_mock.reset_mock()
|
||||
filename = testdatadir / 'testresult.json'
|
||||
store_backtest_stats(filename, {'metadata': {}}, '2022_01_01_15_05_13')
|
||||
store_backtest_stats(filename, data, '2022_01_01_15_05_13')
|
||||
assert dump_mock.call_count == 3
|
||||
assert isinstance(dump_mock.call_args_list[0][0][0], Path)
|
||||
# result will be testdatadir / testresult-<timestamp>.json
|
||||
|
|
Loading…
Reference in New Issue
Block a user