From ff36431680758c3a3652486243c0d4409528e999 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 20 Sep 2022 20:31:06 +0200 Subject: [PATCH] Adjust tests for new messageType handling --- tests/rpc/test_rpc_telegram.py | 15 +++++++++------ tests/test_freqtradebot.py | 5 +++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/rpc/test_rpc_telegram.py b/tests/rpc/test_rpc_telegram.py index f2e490dff..3552d5fe7 100644 --- a/tests/rpc/test_rpc_telegram.py +++ b/tests/rpc/test_rpc_telegram.py @@ -959,6 +959,7 @@ def test_telegram_forceexit_handle(default_conf, update, ticker, fee, 'gain': 'profit', 'leverage': 1.0, 'limit': 1.173e-05, + 'order_rate': 1.173e-05, 'amount': 91.07468123, 'order_type': 'limit', 'open_rate': 1.098e-05, @@ -1031,6 +1032,7 @@ def test_telegram_force_exit_down_handle(default_conf, update, ticker, fee, 'gain': 'loss', 'leverage': 1.0, 'limit': 1.043e-05, + 'order_rate': 1.043e-05, 'amount': 91.07468123, 'order_type': 'limit', 'open_rate': 1.098e-05, @@ -1092,6 +1094,7 @@ def test_forceexit_all_handle(default_conf, update, ticker, fee, mocker) -> None 'pair': 'ETH/BTC', 'gain': 'loss', 'leverage': 1.0, + 'order_rate': 1.099e-05, 'limit': 1.099e-05, 'amount': 91.07468123, 'order_type': 'limit', @@ -1744,7 +1747,7 @@ def test_send_msg_enter_notification(default_conf, mocker, caplog, message_type, 'exchange': 'Binance', 'pair': 'ETH/BTC', 'leverage': leverage, - 'limit': 1.099e-05, + 'open_rate': 1.099e-05, 'order_type': 'limit', 'direction': enter, 'stake_amount': 0.01465333, @@ -1915,7 +1918,7 @@ def test_send_msg_sell_notification(default_conf, mocker) -> None: 'leverage': 1.0, 'direction': 'Long', 'gain': 'loss', - 'limit': 3.201e-05, + 'order_rate': 3.201e-05, 'amount': 1333.3333333333335, 'order_type': 'market', 'open_rate': 7.5e-05, @@ -1950,7 +1953,7 @@ def test_send_msg_sell_notification(default_conf, mocker) -> None: 'pair': 'KEY/ETH', 'direction': 'Long', 'gain': 'loss', - 'limit': 3.201e-05, + 'order_rate': 3.201e-05, 'amount': 1333.3333333333335, 'order_type': 'market', 'open_rate': 7.5e-05, @@ -1989,7 +1992,7 @@ def test_send_msg_sell_notification(default_conf, mocker) -> None: 'pair': 'KEY/ETH', 'direction': 'Long', 'gain': 'loss', - 'limit': 3.201e-05, + 'order_rate': 3.201e-05, 'amount': 1333.3333333333335, 'order_type': 'market', 'open_rate': 7.5e-05, @@ -2162,7 +2165,7 @@ def test_send_msg_buy_notification_no_fiat( 'exchange': 'Binance', 'pair': 'ETH/BTC', 'leverage': leverage, - 'limit': 1.099e-05, + 'open_rate': 1.099e-05, 'order_type': 'limit', 'direction': enter, 'stake_amount': 0.01465333, @@ -2205,7 +2208,7 @@ def test_send_msg_sell_notification_no_fiat( 'gain': 'loss', 'leverage': leverage, 'direction': direction, - 'limit': 3.201e-05, + 'order_rate': 3.201e-05, 'amount': 1333.3333333333335, 'order_type': 'limit', 'open_rate': 7.5e-05, diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index c1152ac09..7851a73f8 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -3256,6 +3256,7 @@ def test_execute_trade_exit_up(default_conf_usdt, ticker_usdt, fee, ticker_usdt_ 'pair': 'ETH/USDT', 'gain': 'profit', 'limit': 2.0 if is_short else 2.2, + 'order_rate': 2.0 if is_short else 2.2, 'amount': pytest.approx(amt), 'order_type': 'limit', 'buy_tag': None, @@ -3321,6 +3322,7 @@ def test_execute_trade_exit_down(default_conf_usdt, ticker_usdt, fee, ticker_usd 'leverage': 1.0, 'gain': 'loss', 'limit': 2.2 if is_short else 2.01, + 'order_rate': 2.2 if is_short else 2.01, 'amount': pytest.approx(29.70297029) if is_short else 30.0, 'order_type': 'limit', 'buy_tag': None, @@ -3405,6 +3407,7 @@ def test_execute_trade_exit_custom_exit_price( 'leverage': 1.0, 'gain': profit_or_loss, 'limit': limit, + 'order_rate': limit, 'amount': pytest.approx(amount), 'order_type': 'limit', 'buy_tag': None, @@ -3476,6 +3479,7 @@ def test_execute_trade_exit_down_stoploss_on_exchange_dry_run( 'leverage': 1.0, 'gain': 'loss', 'limit': 2.02 if is_short else 1.98, + 'order_rate': 2.02 if is_short else 1.98, 'amount': pytest.approx(29.70297029 if is_short else 30.0), 'order_type': 'limit', 'buy_tag': None, @@ -3741,6 +3745,7 @@ def test_execute_trade_exit_market_order( 'leverage': 1.0, 'gain': profit_or_loss, 'limit': limit, + 'order_rate': limit, 'amount': pytest.approx(amount), 'order_type': 'market', 'buy_tag': None,