Merge pull request #2298 from freqtrade/fix/failing_tests

[minor] Fix tests that fail when config.json is present
This commit is contained in:
hroff-1902 2019-09-24 21:19:45 +03:00 committed by GitHub
commit 2d86510acf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -117,12 +117,15 @@ def test_download_data_no_exchange(mocker, caplog):
args = [ args = [
"download-data", "download-data",
] ]
pargs = get_args(args)
pargs['config'] = None
with pytest.raises(OperationalException, with pytest.raises(OperationalException,
match=r"This command requires a configured exchange.*"): match=r"This command requires a configured exchange.*"):
start_download_data(get_args(args)) start_download_data(pargs)
def test_download_data_no_pairs(mocker, caplog): def test_download_data_no_pairs(mocker, caplog):
mocker.patch.object(Path, "exists", MagicMock(return_value=False)) mocker.patch.object(Path, "exists", MagicMock(return_value=False))
mocker.patch('freqtrade.utils.refresh_backtest_ohlcv_data', mocker.patch('freqtrade.utils.refresh_backtest_ohlcv_data',
@ -136,6 +139,8 @@ def test_download_data_no_pairs(mocker, caplog):
"--exchange", "--exchange",
"binance", "binance",
] ]
pargs = get_args(args)
pargs['config'] = None
with pytest.raises(OperationalException, with pytest.raises(OperationalException,
match=r"Downloading data requires a list of pairs\..*"): match=r"Downloading data requires a list of pairs\..*"):
start_download_data(get_args(args)) start_download_data(pargs)