Improve test by having multistrat.meta file available
This commit is contained in:
@@ -1597,8 +1597,9 @@ def test_api_backtest_history(botclient, mocker, testdatadir):
|
||||
rc = client_get(client, f"{BASE_URI}/backtest/history")
|
||||
assert_response(rc)
|
||||
result = rc.json()
|
||||
assert len(result) == 1
|
||||
assert len(result) == 3
|
||||
fn = result[0]['filename']
|
||||
assert fn == "backtest-result_multistrat.json"
|
||||
strategy = result[0]['strategy']
|
||||
rc = client_get(client, f"{BASE_URI}/backtest/history/result?filename={fn}&strategy={strategy}")
|
||||
assert_response(rc)
|
||||
@@ -1607,7 +1608,9 @@ def test_api_backtest_history(botclient, mocker, testdatadir):
|
||||
assert result2['status'] == 'ended'
|
||||
assert not result2['running']
|
||||
assert result2['progress'] == 1
|
||||
assert result2['backtest_result']['strategy'][CURRENT_TEST_STRATEGY]
|
||||
# Only one strategy loaded - even though we use multiresult
|
||||
assert len(result2['backtest_result']['strategy']) == 1
|
||||
assert result2['backtest_result']['strategy'][strategy]
|
||||
|
||||
|
||||
def test_health(botclient):
|
||||
|
10
tests/testdata/backtest_results/backtest-result_multistrat.meta.json
vendored
Normal file
10
tests/testdata/backtest_results/backtest-result_multistrat.meta.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"StrategyTestV2": {
|
||||
"run_id": "430d0271075ef327edbb23088f4db4ebe51a3dbf",
|
||||
"backtest_start_time": 1648904006
|
||||
},
|
||||
"TestStrategy": {
|
||||
"run_id": "110d0271075ef327edbb23085102b4ebe51a3d55",
|
||||
"backtest_start_time": 1648904006
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user