From 162f94872990e56f3f5caa8355d36fa1e40e95d9 Mon Sep 17 00:00:00 2001 From: xmatthias Date: Mon, 18 Jun 2018 19:56:23 +0200 Subject: [PATCH] add test for non-configured exchange --- freqtrade/tests/exchange/test_exchange.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/freqtrade/tests/exchange/test_exchange.py b/freqtrade/tests/exchange/test_exchange.py index d748bdad2..44bf539d0 100644 --- a/freqtrade/tests/exchange/test_exchange.py +++ b/freqtrade/tests/exchange/test_exchange.py @@ -587,11 +587,10 @@ def test_get_id(default_conf, mocker): assert exchange.get_id() == 'binance' -def test_get_pair_detail_url(default_conf, mocker): +def test_get_pair_detail_url(default_conf, mocker, caplog): mocker.patch('freqtrade.exchange.Exchange.validate_pairs', side_effect=lambda s: True) default_conf['exchange']['name'] = 'binance' - # exchange = get_patched_exchange(mocker, default_conf, api_mock) exchange = Exchange(default_conf) url = exchange.get_pair_detail_url('TKN/ETH') @@ -613,6 +612,12 @@ def test_get_pair_detail_url(default_conf, mocker): assert 'LOOONG' in url assert 'BTC' in url + default_conf['exchange']['name'] = 'poloniex' + exchange = Exchange(default_conf) + url = exchange.get_pair_detail_url('LOOONG/BTC') + assert '' == url + assert log_has('Could not get exchange url for Poloniex', caplog.record_tuples) + def test_get_trades_for_order(default_conf, mocker): order_id = 'ABCD-ABCD'