Merge branch 'develop' into test_coverage

This commit is contained in:
kryofly
2018-01-20 21:24:28 +01:00
20 changed files with 448 additions and 159 deletions

View File

@@ -200,14 +200,14 @@ def test_get_ticker(default_conf, mocker, ticker):
assert ticker['ask'] == 1
def test_get_ticker_history(mocker, ticker):
def test_get_ticker_history(default_conf, mocker, ticker):
api_mock = MagicMock()
tick = 123
api_mock.get_ticker_history = MagicMock(return_value=tick)
mocker.patch('freqtrade.exchange._API', api_mock)
# retrieve original ticker
ticks = get_ticker_history(pair='BTC_ETH')
ticks = get_ticker_history('BTC_ETH', int(default_conf['ticker_interval']))
assert ticks == 123
# change the ticker
@@ -216,7 +216,7 @@ def test_get_ticker_history(mocker, ticker):
mocker.patch('freqtrade.exchange._API', api_mock)
# ensure caching will still return the original ticker
get_ticker_history(pair='BTC_ETH')
ticks = get_ticker_history('BTC_ETH', int(default_conf['ticker_interval']))
assert ticks == 123

View File

@@ -232,6 +232,11 @@ def test_exchange_bittrex_get_ticker_bad():
with pytest.raises(btx.OperationalException, match=r'.*gone bad.*'):
wb.get_ticker('BTC_ETH')
fb.result = {'success': True,
'result': {'Bid': 1, 'Ask': 0, 'Last': None}} # incomplete result
with pytest.raises(ContentDecodingError, match=r'.*Got invalid response from bittrex params.*'):
wb.get_ticker('BTC_ETH')
def test_exchange_bittrex_get_ticker_history_one():
wb = make_wrap_bittrex()