Increase code coverage

Change log:
* Increase code coverage for test_exchange.py
* Move Exchange Unit tests files tests/exchange/
* Move RPC Unit tests files tests/rpc/
This commit is contained in:
Gerald Lonlas
2017-12-29 23:12:52 -08:00
parent 9f5f0ddaaa
commit e81a9cbb17
5 changed files with 188 additions and 36 deletions

View File

@@ -0,0 +1,32 @@
# pragma pylint: disable=missing-docstring,C0103
import pytest
from requests.exceptions import ContentDecodingError
from freqtrade.exchange import Bittrex
def test_validate_response_success():
response = {
'message': '',
'result': [],
}
Bittrex._validate_response(response)
def test_validate_response_no_api_response():
response = {
'message': 'NO_API_RESPONSE',
'result': None,
}
with pytest.raises(ContentDecodingError, match=r'.*NO_API_RESPONSE.*'):
Bittrex._validate_response(response)
def test_validate_response_min_trade_requirement_not_met():
response = {
'message': 'MIN_TRADE_REQUIREMENT_NOT_MET',
'result': None,
}
with pytest.raises(ContentDecodingError, match=r'.*MIN_TRADE_REQUIREMENT_NOT_MET.*'):
Bittrex._validate_response(response)