Make flake happy again
This commit is contained in:
parent
8564affdf0
commit
2ebddcf45c
@ -925,17 +925,17 @@ def test_get_balances_prod(default_conf, mocker, exchange_name):
|
|||||||
def test_get_tickers(default_conf, mocker, exchange_name):
|
def test_get_tickers(default_conf, mocker, exchange_name):
|
||||||
api_mock = MagicMock()
|
api_mock = MagicMock()
|
||||||
tick = {'ETH/BTC': {
|
tick = {'ETH/BTC': {
|
||||||
'symbol': 'ETH/BTC',
|
'symbol': 'ETH/BTC',
|
||||||
'bid': 0.5,
|
'bid': 0.5,
|
||||||
'ask': 1,
|
'ask': 1,
|
||||||
'last': 42,
|
'last': 42,
|
||||||
}, 'BCH/BTC': {
|
}, 'BCH/BTC': {
|
||||||
'symbol': 'BCH/BTC',
|
'symbol': 'BCH/BTC',
|
||||||
'bid': 0.6,
|
'bid': 0.6,
|
||||||
'ask': 0.5,
|
'ask': 0.5,
|
||||||
'last': 41,
|
'last': 41,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
api_mock.fetch_tickers = MagicMock(return_value=tick)
|
api_mock.fetch_tickers = MagicMock(return_value=tick)
|
||||||
exchange = get_patched_exchange(mocker, default_conf, api_mock, id=exchange_name)
|
exchange = get_patched_exchange(mocker, default_conf, api_mock, id=exchange_name)
|
||||||
# retrieve original ticker
|
# retrieve original ticker
|
||||||
@ -1488,59 +1488,60 @@ def test_get_valid_pair_combination(default_conf, mocker, markets):
|
|||||||
ex.get_valid_pair_combination("NOPAIR", "ETH")
|
ex.get_valid_pair_combination("NOPAIR", "ETH")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("base_currencies, quote_currencies, pairs_only, active_only,"
|
@pytest.mark.parametrize(
|
||||||
"expected_keys", [
|
"base_currencies, quote_currencies, pairs_only, active_only, expected_keys", [
|
||||||
# Testing markets (in conftest.py):
|
# Testing markets (in conftest.py):
|
||||||
# 'BLK/BTC': 'active': True
|
# 'BLK/BTC': 'active': True
|
||||||
# 'BTT/BTC': 'active': True
|
# 'BTT/BTC': 'active': True
|
||||||
# 'ETH/BTC': 'active': True
|
# 'ETH/BTC': 'active': True
|
||||||
# 'ETH/USDT': 'active': True
|
# 'ETH/USDT': 'active': True
|
||||||
# 'LTC/BTC': 'active': False
|
# 'LTC/BTC': 'active': False
|
||||||
# 'LTC/USD': 'active': True
|
# 'LTC/USD': 'active': True
|
||||||
# 'LTC/USDT': 'active': True
|
# 'LTC/USDT': 'active': True
|
||||||
# 'NEO/BTC': 'active': False
|
# 'NEO/BTC': 'active': False
|
||||||
# 'TKN/BTC': 'active' not set
|
# 'TKN/BTC': 'active' not set
|
||||||
# 'XLTCUSDT': 'active': True, not a pair
|
# 'XLTCUSDT': 'active': True, not a pair
|
||||||
# 'XRP/BTC': 'active': False
|
# 'XRP/BTC': 'active': False
|
||||||
# all markets
|
# all markets
|
||||||
([], [], False, False,
|
([], [], False, False,
|
||||||
['BLK/BTC', 'BTT/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/USD', 'LTC/USDT', 'NEO/BTC',
|
['BLK/BTC', 'BTT/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/USD',
|
||||||
'TKN/BTC', 'XLTCUSDT', 'XRP/BTC']),
|
'LTC/USDT', 'NEO/BTC', 'TKN/BTC', 'XLTCUSDT', 'XRP/BTC']),
|
||||||
# active markets
|
# active markets
|
||||||
([], [], False, True,
|
([], [], False, True,
|
||||||
['BLK/BTC', 'BTT/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/USD', 'LTC/USDT', 'TKN/BTC', 'XLTCUSDT']),
|
['BLK/BTC', 'BTT/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/USD', 'LTC/USDT',
|
||||||
# all pairs
|
'TKN/BTC', 'XLTCUSDT']),
|
||||||
([], [], True, False,
|
# all pairs
|
||||||
['BLK/BTC', 'BTT/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/USD', 'LTC/USDT', 'NEO/BTC',
|
([], [], True, False,
|
||||||
'TKN/BTC', 'XRP/BTC']),
|
['BLK/BTC', 'BTT/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/USD',
|
||||||
# active pairs
|
'LTC/USDT', 'NEO/BTC', 'TKN/BTC', 'XRP/BTC']),
|
||||||
([], [], True, True,
|
# active pairs
|
||||||
['BLK/BTC', 'BTT/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/USD', 'LTC/USDT', 'TKN/BTC']),
|
([], [], True, True,
|
||||||
# all markets, base=ETH, LTC
|
['BLK/BTC', 'BTT/BTC', 'ETH/BTC', 'ETH/USDT', 'LTC/USD', 'LTC/USDT', 'TKN/BTC']),
|
||||||
(['ETH', 'LTC'], [], False, False,
|
# all markets, base=ETH, LTC
|
||||||
['ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/USD', 'LTC/USDT', 'XLTCUSDT']),
|
(['ETH', 'LTC'], [], False, False,
|
||||||
# all markets, base=LTC
|
['ETH/BTC', 'ETH/USDT', 'LTC/BTC', 'LTC/USD', 'LTC/USDT', 'XLTCUSDT']),
|
||||||
(['LTC'], [], False, False,
|
# all markets, base=LTC
|
||||||
['LTC/BTC', 'LTC/USD', 'LTC/USDT', 'XLTCUSDT']),
|
(['LTC'], [], False, False,
|
||||||
# all markets, quote=USDT
|
['LTC/BTC', 'LTC/USD', 'LTC/USDT', 'XLTCUSDT']),
|
||||||
([], ['USDT'], False, False,
|
# all markets, quote=USDT
|
||||||
['ETH/USDT', 'LTC/USDT', 'XLTCUSDT']),
|
([], ['USDT'], False, False,
|
||||||
# all markets, quote=USDT, USD
|
['ETH/USDT', 'LTC/USDT', 'XLTCUSDT']),
|
||||||
([], ['USDT', 'USD'], False, False,
|
# all markets, quote=USDT, USD
|
||||||
['ETH/USDT', 'LTC/USD', 'LTC/USDT', 'XLTCUSDT']),
|
([], ['USDT', 'USD'], False, False,
|
||||||
# all markets, base=LTC, quote=USDT
|
['ETH/USDT', 'LTC/USD', 'LTC/USDT', 'XLTCUSDT']),
|
||||||
(['LTC'], ['USDT'], False, False,
|
# all markets, base=LTC, quote=USDT
|
||||||
['LTC/USDT', 'XLTCUSDT']),
|
(['LTC'], ['USDT'], False, False,
|
||||||
# all pairs, base=LTC, quote=USDT
|
['LTC/USDT', 'XLTCUSDT']),
|
||||||
(['LTC'], ['USDT'], True, False,
|
# all pairs, base=LTC, quote=USDT
|
||||||
['LTC/USDT']),
|
(['LTC'], ['USDT'], True, False,
|
||||||
# all markets, base=LTC, quote=USDT, NONEXISTENT
|
['LTC/USDT']),
|
||||||
(['LTC'], ['USDT', 'NONEXISTENT'], False, False,
|
# all markets, base=LTC, quote=USDT, NONEXISTENT
|
||||||
['LTC/USDT', 'XLTCUSDT']),
|
(['LTC'], ['USDT', 'NONEXISTENT'], False, False,
|
||||||
# all markets, base=LTC, quote=NONEXISTENT
|
['LTC/USDT', 'XLTCUSDT']),
|
||||||
(['LTC'], ['NONEXISTENT'], False, False,
|
# all markets, base=LTC, quote=NONEXISTENT
|
||||||
[]),
|
(['LTC'], ['NONEXISTENT'], False, False,
|
||||||
])
|
[]),
|
||||||
|
])
|
||||||
def test_get_markets(default_conf, mocker, markets,
|
def test_get_markets(default_conf, mocker, markets,
|
||||||
base_currencies, quote_currencies, pairs_only, active_only,
|
base_currencies, quote_currencies, pairs_only, active_only,
|
||||||
expected_keys):
|
expected_keys):
|
||||||
|
Loading…
Reference in New Issue
Block a user