/balance should use cached tickers when possible
This commit is contained in:
@@ -1319,6 +1319,14 @@ def test_get_tickers(default_conf, mocker, exchange_name):
|
||||
assert tickers['ETH/BTC']['ask'] == 1
|
||||
assert tickers['BCH/BTC']['bid'] == 0.6
|
||||
assert tickers['BCH/BTC']['ask'] == 0.5
|
||||
assert api_mock.fetch_tickers.call_count == 1
|
||||
|
||||
api_mock.fetch_tickers.reset_mock()
|
||||
|
||||
# Cached ticker should not call api again
|
||||
tickers2 = exchange.get_tickers(cached=True)
|
||||
assert tickers2 == tickers
|
||||
assert api_mock.fetch_tickers.call_count == 0
|
||||
|
||||
ccxt_exceptionhandlers(mocker, default_conf, api_mock, exchange_name,
|
||||
"get_tickers", "fetch_tickers")
|
||||
|
Reference in New Issue
Block a user