Test get_amount_lots

This commit is contained in:
Matthias Voppichler 2018-04-16 19:43:13 +02:00
parent f69e8458f4
commit 7f4c70827a

View File

@ -10,7 +10,8 @@ import pytest
from freqtrade import OperationalException, DependencyException, NetworkException
from freqtrade.exchange import init, validate_pairs, buy, sell, get_balance, get_balances, \
get_ticker, get_ticker_history, cancel_order, get_name, get_fee, get_id, get_pair_detail_url
get_ticker, get_ticker_history, cancel_order, get_name, get_fee, get_id, get_pair_detail_url, \
get_amount_lots
import freqtrade.exchange as exchange
from freqtrade.tests.conftest import log_has
@ -499,3 +500,10 @@ def test_get_fee(default_conf, mocker):
})
mocker.patch('freqtrade.exchange._API', api_mock)
assert get_fee() == 0.025
def test_get_amount_lots(default_conf, mocker):
api_mock = MagicMock()
api_mock.amount_to_lots = MagicMock(return_value=1.0)
mocker.patch('freqtrade.exchange._API', api_mock)
assert get_amount_lots('LTC/BTC', 1.54) == 1