Merge branch 'develop' into list-pairs

This commit is contained in:
hroff-1902 2019-07-02 22:24:20 +03:00 committed by GitHub
commit d1f27d0b0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 4 deletions

View File

@ -286,7 +286,6 @@ class Exchange(object):
""" """
Checks if ticker interval from config is a supported timeframe on the exchange Checks if ticker interval from config is a supported timeframe on the exchange
""" """
logger.warning("validate_timerames")
if not hasattr(self._api, "timeframes"): if not hasattr(self._api, "timeframes"):
# If timeframes is missing, the exchange probably has no fetchOHLCV method. # If timeframes is missing, the exchange probably has no fetchOHLCV method.
# Therefore we also show that. # Therefore we also show that.

View File

@ -396,6 +396,23 @@ def test_validate_timeframes_failed(default_conf, mocker):
Exchange(default_conf) Exchange(default_conf)
def test_validate_timeframes_emulated_ohlcv(default_conf, mocker):
default_conf["ticker_interval"] = "3m"
api_mock = MagicMock()
id_mock = PropertyMock(return_value='test_exchange')
type(api_mock).id = id_mock
# delete timeframes so magicmock does not autocreate it
del api_mock.timeframes
mocker.patch('freqtrade.exchange.Exchange._init_ccxt', MagicMock(return_value=api_mock))
mocker.patch('freqtrade.exchange.Exchange._load_markets', MagicMock(return_value={}))
mocker.patch('freqtrade.exchange.Exchange.validate_pairs', MagicMock())
with pytest.raises(OperationalException,
match=r'This exchange (.*) does not have a `timeframes` attribute and*'):
Exchange(default_conf)
def test_validate_timeframes_not_in_config(default_conf, mocker): def test_validate_timeframes_not_in_config(default_conf, mocker):
del default_conf["ticker_interval"] del default_conf["ticker_interval"]
api_mock = MagicMock() api_mock = MagicMock()

View File

@ -1,6 +1,6 @@
# requirements without requirements installable via conda # requirements without requirements installable via conda
# mainly used for Raspberry pi installs # mainly used for Raspberry pi installs
ccxt==1.18.805 ccxt==1.18.860
SQLAlchemy==1.3.5 SQLAlchemy==1.3.5
python-telegram-bot==11.1.0 python-telegram-bot==11.1.0
arrow==0.14.2 arrow==0.14.2

View File

@ -5,9 +5,9 @@
flake8==3.7.7 flake8==3.7.7
flake8-type-annotations==0.1.0 flake8-type-annotations==0.1.0
flake8-tidy-imports==2.0.0 flake8-tidy-imports==2.0.0
pytest==4.6.3 pytest==5.0.0
pytest-mock==1.10.4 pytest-mock==1.10.4
pytest-asyncio==0.10.0 pytest-asyncio==0.10.0
pytest-cov==2.7.1 pytest-cov==2.7.1
coveralls==1.8.1 coveralls==1.8.1
mypy==0.710 mypy==0.711