mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Fix tests for use public trades
This commit is contained in:
parent
1f783b2995
commit
aa663b926a
|
@ -820,11 +820,12 @@ def test_download_data_trades(mocker):
|
||||||
"--trading-mode", "futures",
|
"--trading-mode", "futures",
|
||||||
"--dl-trades"
|
"--dl-trades"
|
||||||
]
|
]
|
||||||
with pytest.raises(OperationalException,
|
pargs = get_args(args)
|
||||||
match="Trade download not supported for futures."):
|
pargs['config'] = None
|
||||||
pargs = get_args(args)
|
start_download_data(pargs)
|
||||||
pargs['config'] = None
|
assert dl_mock.call_args[1]['timerange'].starttype == "date"
|
||||||
start_download_data(pargs)
|
assert dl_mock.call_count == 2
|
||||||
|
assert convert_mock.call_count == 2
|
||||||
|
|
||||||
|
|
||||||
def test_download_data_data_invalid(mocker):
|
def test_download_data_data_invalid(mocker):
|
||||||
|
|
|
@ -78,9 +78,10 @@ def test_download_data_main_trades(mocker):
|
||||||
"trading_mode": "futures",
|
"trading_mode": "futures",
|
||||||
})
|
})
|
||||||
|
|
||||||
with pytest.raises(OperationalException,
|
download_data_main(config)
|
||||||
match="Trade download not supported for futures."):
|
assert dl_mock.call_args[1]['timerange'].starttype == "date"
|
||||||
download_data_main(config)
|
assert dl_mock.call_count == 2
|
||||||
|
assert convert_mock.call_count == 2
|
||||||
|
|
||||||
|
|
||||||
def test_download_data_main_data_invalid(mocker):
|
def test_download_data_main_data_invalid(mocker):
|
||||||
|
|
|
@ -612,7 +612,7 @@ def test_download_trades_history(trades_history, mocker, default_conf, testdatad
|
||||||
|
|
||||||
assert not _download_trades_history(data_handler=data_handler, exchange=exchange,
|
assert not _download_trades_history(data_handler=data_handler, exchange=exchange,
|
||||||
pair='ETH/BTC')
|
pair='ETH/BTC')
|
||||||
assert log_has_re('Failed to download historic trades for pair: "ETH/BTC".*', caplog)
|
assert log_has_re('Failed to download and store historic trades for pair: "ETH/BTC".*', caplog)
|
||||||
|
|
||||||
file2 = tmp_path / 'XRP_ETH-trades.json.gz'
|
file2 = tmp_path / 'XRP_ETH-trades.json.gz'
|
||||||
copyfile(testdatadir / file2.name, file2)
|
copyfile(testdatadir / file2.name, file2)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user