remove maybe_update_amount and tests

This commit is contained in:
Matthias Voppichler
2018-04-23 20:03:10 +02:00
parent 93a7c46977
commit f580fbb91d
2 changed files with 1 additions and 73 deletions

View File

@@ -1410,53 +1410,3 @@ def test_get_real_amount_multi(default_conf, trades_for_order2, mocker):
freqtrade = FreqtradeBot(default_conf, create_engine('sqlite://'))
# Amount is reduced by "fee"
assert freqtrade.get_real_amount(trade) == amount - (amount * 0.001)
def test_maybe_update_real_amount(default_conf, trades_for_order, mocker):
"""
Test get_real_amount with split trades (multiple trades for this order)
"""
patch_get_signal(mocker)
patch_RPCManager(mocker)
patch_coinmarketcap(mocker)
mocker.patch('freqtrade.exchange.validate_pairs', MagicMock(return_value=True))
mocker.patch('freqtrade.exchange.get_trades_for_order', return_value=trades_for_order)
amount = float(sum(x['amount'] for x in trades_for_order))
trade = Trade(
pair='LTC/ETH',
amount=amount,
exchange='binance',
open_rate=0.245441,
open_order_id="123456"
)
freqtrade = FreqtradeBot(default_conf, create_engine('sqlite://'))
# Amount is reduced by "fee"
assert freqtrade.maybe_update_real_amount(trade) is True
assert trade.amount == amount - (amount * 0.001)
def test_maybe_update_real_amount_stake(default_conf, trades_for_order, mocker):
"""
Test get_real_amount with split trades (multiple trades for this order)
"""
trades_for_order[0]['fee']['currency'] = 'ETH'
patch_get_signal(mocker)
patch_RPCManager(mocker)
patch_coinmarketcap(mocker)
mocker.patch('freqtrade.exchange.validate_pairs', MagicMock(return_value=True))
mocker.patch('freqtrade.exchange.get_trades_for_order', return_value=trades_for_order)
amount = float(sum(x['amount'] for x in trades_for_order))
trade = Trade(
pair='LTC/ETH',
amount=amount,
exchange='binance',
open_rate=0.245441,
open_order_id="123456"
)
freqtrade = FreqtradeBot(default_conf, create_engine('sqlite://'))
# Amount is reduced by "fee"
assert freqtrade.maybe_update_real_amount(trade) is True
assert trade.amount == amount