Add retrier decorator

This commit is contained in:
enenn
2018-03-24 08:46:20 +01:00
parent 45764df6b0
commit aa3c1a953a
2 changed files with 22 additions and 3 deletions

View File

@@ -307,7 +307,7 @@ def test_get_ticker(default_conf, mocker):
assert ticker['bid'] == 0.5
assert ticker['ask'] == 1
with pytest.raises(NetworkException):
with pytest.raises(OperationalException): # test retrier
api_mock.fetch_ticker = MagicMock(side_effect=ccxt.NetworkError)
mocker.patch('freqtrade.exchange._API', api_mock)
get_ticker(pair='ETH/BTC', refresh=True)
@@ -365,7 +365,7 @@ def test_get_ticker_history(default_conf, mocker):
assert ticks[0]['C'] == 4
assert ticks[0]['V'] == 5
with pytest.raises(NetworkException):
with pytest.raises(OperationalException): # test retrier
api_mock.fetch_ohlcv = MagicMock(side_effect=ccxt.NetworkError)
mocker.patch('freqtrade.exchange._API', api_mock)
# new symbol to get around cache