Move .title to ExchangeResolver (it does not make sense to do this over
and over again)
This commit is contained in:
@@ -60,7 +60,7 @@ def get_patched_exchange(mocker, config, api_mock=None, id='bittrex') -> Exchang
|
||||
patch_exchange(mocker, api_mock, id)
|
||||
config["exchange"]["name"] = id
|
||||
try:
|
||||
exchange = ExchangeResolver(id.title(), config).exchange
|
||||
exchange = ExchangeResolver(id, config).exchange
|
||||
except ImportError:
|
||||
exchange = Exchange(config)
|
||||
return exchange
|
||||
|
@@ -124,14 +124,14 @@ def test_exchange_resolver(default_conf, mocker, caplog):
|
||||
caplog.record_tuples)
|
||||
caplog.clear()
|
||||
|
||||
exchange = ExchangeResolver('Kraken', default_conf).exchange
|
||||
exchange = ExchangeResolver('kraken', default_conf).exchange
|
||||
assert isinstance(exchange, Exchange)
|
||||
assert isinstance(exchange, Kraken)
|
||||
assert not isinstance(exchange, Binance)
|
||||
assert not log_has_re(r"No .* specific subclass found. Using the generic class instead.",
|
||||
caplog.record_tuples)
|
||||
|
||||
exchange = ExchangeResolver('Binance', default_conf).exchange
|
||||
exchange = ExchangeResolver('binance', default_conf).exchange
|
||||
assert isinstance(exchange, Exchange)
|
||||
assert isinstance(exchange, Binance)
|
||||
assert not isinstance(exchange, Kraken)
|
||||
|
Reference in New Issue
Block a user