fixed tests failed after merge
This commit is contained in:
parent
debb8f7485
commit
a77e3ea378
@ -557,7 +557,7 @@ class FreqtradeBot(LoggingMixin):
|
||||
f"Adjusting amount to trade.amount as it is higher. {amount} > {trade.amount}")
|
||||
amount = trade.amount
|
||||
self.execute_trade_exit(trade, current_exit_rate, exit_check=ExitCheckTuple(
|
||||
exit_type=ExitType.PARTIAL_SELL), sub_trade_amt=amount)
|
||||
exit_type=ExitType.PARTIAL_EXIT), sub_trade_amt=amount)
|
||||
|
||||
def _check_depth_of_market(self, pair: str, conf: Dict, side: SignalDirection) -> bool:
|
||||
"""
|
||||
|
@ -1947,6 +1947,7 @@ def test_send_msg_entry_fill_notification(default_conf, mocker, message_type, en
|
||||
'leverage': leverage,
|
||||
'stake_amount': 0.01465333,
|
||||
'sub_trade': True,
|
||||
'direction': entered,
|
||||
'stake_currency': 'BTC',
|
||||
'fiat_currency': 'USD',
|
||||
'open_rate': 1.099e-05,
|
||||
@ -1955,7 +1956,7 @@ def test_send_msg_entry_fill_notification(default_conf, mocker, message_type, en
|
||||
})
|
||||
|
||||
assert msg_mock.call_args[0][0] \
|
||||
== f'\N{CHECK MARK} *Binance:* {entered} ETH/BTC (#1)\n' \
|
||||
== f'\N{CHECK MARK} *Binance:* {entered}ed ETH/BTC (#1)\n' \
|
||||
f'*Enter Tag:* `{enter_signal}`\n' \
|
||||
'*Amount:* `1333.33333333`\n' \
|
||||
f"{leverage_text}" \
|
||||
@ -2045,7 +2046,7 @@ def test_send_msg_sell_notification(default_conf, mocker) -> None:
|
||||
|
||||
msg_mock.reset_mock()
|
||||
telegram.send_msg({
|
||||
'type': RPCMessageType.SELL,
|
||||
'type': RPCMessageType.EXIT,
|
||||
'trade_id': 1,
|
||||
'exchange': 'Binance',
|
||||
'pair': 'KEY/ETH',
|
||||
|
@ -5414,7 +5414,7 @@ def test_position_adjust(mocker, default_conf_usdt, fee) -> None:
|
||||
mocker.patch('freqtrade.exchange.Exchange.fetch_order_or_stoploss_order',
|
||||
MagicMock(return_value=closed_sell_dca_order_1))
|
||||
assert freqtrade.execute_trade_exit(trade=trade, limit=8,
|
||||
exit_check=ExitCheckTuple(exit_type=ExitType.PARTIAL_SELL),
|
||||
exit_check=ExitCheckTuple(exit_type=ExitType.PARTIAL_EXIT),
|
||||
sub_trade_amt=15)
|
||||
|
||||
# Assert trade is as expected (averaged dca)
|
||||
@ -5546,7 +5546,7 @@ def test_position_adjust2(mocker, default_conf_usdt, fee) -> None:
|
||||
mocker.patch('freqtrade.exchange.Exchange.fetch_order_or_stoploss_order',
|
||||
MagicMock(return_value=closed_sell_dca_order_1))
|
||||
assert freqtrade.execute_trade_exit(trade=trade, limit=ask,
|
||||
exit_check=ExitCheckTuple(exit_type=ExitType.PARTIAL_SELL),
|
||||
exit_check=ExitCheckTuple(exit_type=ExitType.PARTIAL_EXIT),
|
||||
sub_trade_amt=amount)
|
||||
trades: List[Trade] = trade.get_open_trades_without_assigned_fees()
|
||||
assert len(trades) == 1
|
||||
@ -5592,7 +5592,7 @@ def test_position_adjust2(mocker, default_conf_usdt, fee) -> None:
|
||||
mocker.patch('freqtrade.exchange.Exchange.fetch_order_or_stoploss_order',
|
||||
MagicMock(return_value=closed_sell_dca_order_2))
|
||||
assert freqtrade.execute_trade_exit(trade=trade, limit=ask,
|
||||
exit_check=ExitCheckTuple(exit_type=ExitType.PARTIAL_SELL),
|
||||
exit_check=ExitCheckTuple(exit_type=ExitType.PARTIAL_EXIT),
|
||||
sub_trade_amt=amount)
|
||||
# Assert trade is as expected (averaged dca)
|
||||
|
||||
@ -5688,7 +5688,7 @@ def test_position_adjust3(mocker, default_conf_usdt, fee, data) -> None:
|
||||
else:
|
||||
assert freqtrade.execute_trade_exit(
|
||||
trade=trade, limit=price,
|
||||
exit_check=ExitCheckTuple(exit_type=ExitType.PARTIAL_SELL),
|
||||
exit_check=ExitCheckTuple(exit_type=ExitType.PARTIAL_EXIT),
|
||||
sub_trade_amt=amount)
|
||||
|
||||
orders1 = Order.query.all()
|
||||
|
Loading…
Reference in New Issue
Block a user