Introduce markets_static fixture serving an immutable list of markets. Adapt pairlist/markets tests to use this new fixture.

This allows freely modifying markets in get_markets() without a need of updating pairlist/markets tests.
This commit is contained in:
Rokas Kupstys
2021-09-29 10:15:05 +03:00
parent 5726886b06
commit e025576d8c
4 changed files with 26 additions and 12 deletions

View File

@@ -2735,7 +2735,7 @@ def test_get_valid_pair_combination(default_conf, mocker, markets):
(['LTC'], ['NONEXISTENT'], False, False,
[]),
])
def test_get_markets(default_conf, mocker, markets,
def test_get_markets(default_conf, mocker, markets_static,
base_currencies, quote_currencies, pairs_only, active_only,
expected_keys):
mocker.patch.multiple('freqtrade.exchange.Exchange',
@@ -2743,7 +2743,7 @@ def test_get_markets(default_conf, mocker, markets,
_load_async_markets=MagicMock(),
validate_pairs=MagicMock(),
validate_timeframes=MagicMock(),
markets=PropertyMock(return_value=markets))
markets=PropertyMock(return_value=markets_static))
ex = Exchange(default_conf)
pairs = ex.get_markets(base_currencies, quote_currencies, pairs_only, active_only)
assert sorted(pairs.keys()) == sorted(expected_keys)