Add validation to make sure strategies work on that exchange

This commit is contained in:
Matthias
2019-10-27 10:38:21 +01:00
parent 223f0cd4d3
commit 73f5bff9c5
3 changed files with 25 additions and 0 deletions

View File

@@ -533,6 +533,20 @@ def test_validate_order_types_not_in_config(default_conf, mocker):
Exchange(conf)
def test_validate_required_startup_candles(default_conf, mocker, caplog):
api_mock = MagicMock()
default_conf['startup_candle_count'] = 2000
mocker.patch('freqtrade.exchange.Exchange.name', PropertyMock(return_value='Binance'))
mocker.patch('freqtrade.exchange.Exchange._init_ccxt', api_mock)
mocker.patch('freqtrade.exchange.Exchange.validate_timeframes', MagicMock())
mocker.patch('freqtrade.exchange.Exchange._load_async_markets', MagicMock())
mocker.patch('freqtrade.exchange.Exchange.validate_pairs', MagicMock())
with pytest.raises(OperationalException, match=r'This strategy requires 2000.*'):
Exchange(default_conf)
def test_exchange_has(default_conf, mocker):
exchange = get_patched_exchange(mocker, default_conf)
assert not exchange.exchange_has('ASDFASDF')