mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 18:23:55 +00:00
increase get_fee coverage
This commit is contained in:
parent
d156de39f1
commit
c9f8dfc6c5
|
@ -581,6 +581,20 @@ def test_get_fee(default_conf, mocker):
|
|||
|
||||
assert exchange.get_fee() == 0.025
|
||||
|
||||
# test Exceptions
|
||||
api_mock = MagicMock()
|
||||
api_mock.calculate_fee = MagicMock(side_effect=ccxt.BaseError)
|
||||
exchange = get_patched_exchange(mocker, default_conf, api_mock)
|
||||
with pytest.raises(OperationalException):
|
||||
exchange.get_fee()
|
||||
|
||||
api_mock = MagicMock()
|
||||
api_mock.calculate_fee = MagicMock(side_effect=ccxt.NetworkError)
|
||||
exchange = get_patched_exchange(mocker, default_conf, api_mock)
|
||||
with pytest.raises(TemporaryError):
|
||||
exchange.get_fee()
|
||||
assert api_mock.calculate_fee.call_count == API_RETRY_COUNT + 1
|
||||
|
||||
|
||||
def test_get_amount_lots(default_conf, mocker):
|
||||
api_mock = MagicMock()
|
||||
|
|
Loading…
Reference in New Issue
Block a user