From aa663b926a5190c4ff2a1a0965b7478641252243 Mon Sep 17 00:00:00 2001 From: Joe Schr <8218910+TheJoeSchr@users.noreply.github.com> Date: Tue, 6 Feb 2024 14:33:13 +0100 Subject: [PATCH] Fix tests for use public trades --- tests/commands/test_commands.py | 11 ++++++----- tests/data/test_download_data.py | 7 ++++--- tests/data/test_history.py | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index cdad46407..26fb88eb9 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -820,11 +820,12 @@ def test_download_data_trades(mocker): "--trading-mode", "futures", "--dl-trades" ] - with pytest.raises(OperationalException, - match="Trade download not supported for futures."): - pargs = get_args(args) - pargs['config'] = None - start_download_data(pargs) + pargs = get_args(args) + pargs['config'] = None + start_download_data(pargs) + assert dl_mock.call_args[1]['timerange'].starttype == "date" + assert dl_mock.call_count == 2 + assert convert_mock.call_count == 2 def test_download_data_data_invalid(mocker): diff --git a/tests/data/test_download_data.py b/tests/data/test_download_data.py index 97640d01c..d1076ac6f 100644 --- a/tests/data/test_download_data.py +++ b/tests/data/test_download_data.py @@ -78,9 +78,10 @@ def test_download_data_main_trades(mocker): "trading_mode": "futures", }) - with pytest.raises(OperationalException, - match="Trade download not supported for futures."): - download_data_main(config) + download_data_main(config) + assert dl_mock.call_args[1]['timerange'].starttype == "date" + assert dl_mock.call_count == 2 + assert convert_mock.call_count == 2 def test_download_data_main_data_invalid(mocker): diff --git a/tests/data/test_history.py b/tests/data/test_history.py index a48d34aee..2844c3387 100644 --- a/tests/data/test_history.py +++ b/tests/data/test_history.py @@ -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, 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' copyfile(testdatadir / file2.name, file2)