Replace market_is_pair() by symbol_is_pair()

This commit is contained in:
hroff-1902
2019-10-17 18:44:25 +03:00
parent e8eb968a6f
commit b6e26c82ea
4 changed files with 27 additions and 26 deletions

View File

@@ -19,7 +19,7 @@ from freqtrade.exchange.exchange import (API_RETRY_COUNT, timeframe_to_minutes,
timeframe_to_next_date,
timeframe_to_prev_date,
timeframe_to_seconds,
market_is_pair)
symbol_is_pair)
from freqtrade.resolvers.exchange_resolver import ExchangeResolver
from tests.conftest import get_patched_exchange, log_has, log_has_re
@@ -1558,22 +1558,22 @@ def test_timeframe_to_next_date():
assert timeframe_to_next_date("5m") > date
@pytest.mark.parametrize("market,base_currency,quote_currency,expected_result", [
({'symbol': "BTC/USDT"}, None, None, True),
({'symbol': "USDT/BTC"}, None, None, True),
({'symbol': "BTCUSDT"}, None, None, False),
({'symbol': "BTC/USDT"}, None, "USDT", True),
({'symbol': "USDT/BTC"}, None, "USDT", False),
({'symbol': "BTCUSDT"}, None, "USDT", False),
({'symbol': "BTC/USDT"}, "BTC", None, True),
({'symbol': "USDT/BTC"}, "BTC", None, False),
({'symbol': "BTCUSDT"}, "BTC", None, False),
({'symbol': "BTC/USDT"}, "BTC", "USDT", True),
({'symbol': "BTC/USDT"}, "USDT", "BTC", False),
({'symbol': "BTC/USDT"}, "BTC", "USD", False),
({'symbol': "BTCUSDT"}, "BTC", "USDT", False),
({'symbol': "BTC/"}, None, None, False),
({'symbol': "/USDT"}, None, None, False),
@pytest.mark.parametrize("market_symbol,base_currency,quote_currency,expected_result", [
("BTC/USDT", None, None, True),
("USDT/BTC", None, None, True),
("BTCUSDT", None, None, False),
("BTC/USDT", None, "USDT", True),
("USDT/BTC", None, "USDT", False),
("BTCUSDT", None, "USDT", False),
("BTC/USDT", "BTC", None, True),
("USDT/BTC", "BTC", None, False),
("BTCUSDT", "BTC", None, False),
("BTC/USDT", "BTC", "USDT", True),
("BTC/USDT", "USDT", "BTC", False),
("BTC/USDT", "BTC", "USD", False),
("BTCUSDT", "BTC", "USDT", False),
("BTC/", None, None, False),
("/USDT", None, None, False),
])
def test_market_is_pair(market, base_currency, quote_currency, expected_result) -> None:
assert market_is_pair(market, base_currency, quote_currency) == expected_result
def test_symbol_is_pair(market_symbol, base_currency, quote_currency, expected_result) -> None:
assert symbol_is_pair(market_symbol, base_currency, quote_currency) == expected_result