From a77e3ea378e111025150d0b3caf0d57062095d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=AE=AE=E0=AE=A9=E0=AF=8B=E0=AE=9C=E0=AF=8D=E0=AE=95?= =?UTF-8?q?=E0=AF=81=E0=AE=AE=E0=AE=BE=E0=AE=B0=E0=AF=8D=20=E0=AE=AA?= =?UTF-8?q?=E0=AE=B4=E0=AE=A9=E0=AE=BF=E0=AE=9A=E0=AF=8D=E0=AE=9A=E0=AE=BE?= =?UTF-8?q?=E0=AE=AE=E0=AE=BF?= Date: Tue, 5 Apr 2022 19:30:38 +0530 Subject: [PATCH] fixed tests failed after merge --- freqtrade/freqtradebot.py | 2 +- tests/rpc/test_rpc_telegram.py | 5 +++-- tests/test_freqtradebot.py | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index fa9bd7392..5a70ed470 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -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: """ diff --git a/tests/rpc/test_rpc_telegram.py b/tests/rpc/test_rpc_telegram.py index b055a9fc8..ff89d0206 100644 --- a/tests/rpc/test_rpc_telegram.py +++ b/tests/rpc/test_rpc_telegram.py @@ -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', diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index 5695eebf0..7026df81c 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -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()