Adjust tests for new messageType handling

This commit is contained in:
Matthias 2022-09-20 20:31:06 +02:00
parent 3b0874eb37
commit ff36431680
2 changed files with 14 additions and 6 deletions

View File

@ -959,6 +959,7 @@ def test_telegram_forceexit_handle(default_conf, update, ticker, fee,
'gain': 'profit', 'gain': 'profit',
'leverage': 1.0, 'leverage': 1.0,
'limit': 1.173e-05, 'limit': 1.173e-05,
'order_rate': 1.173e-05,
'amount': 91.07468123, 'amount': 91.07468123,
'order_type': 'limit', 'order_type': 'limit',
'open_rate': 1.098e-05, 'open_rate': 1.098e-05,
@ -1031,6 +1032,7 @@ def test_telegram_force_exit_down_handle(default_conf, update, ticker, fee,
'gain': 'loss', 'gain': 'loss',
'leverage': 1.0, 'leverage': 1.0,
'limit': 1.043e-05, 'limit': 1.043e-05,
'order_rate': 1.043e-05,
'amount': 91.07468123, 'amount': 91.07468123,
'order_type': 'limit', 'order_type': 'limit',
'open_rate': 1.098e-05, 'open_rate': 1.098e-05,
@ -1092,6 +1094,7 @@ def test_forceexit_all_handle(default_conf, update, ticker, fee, mocker) -> None
'pair': 'ETH/BTC', 'pair': 'ETH/BTC',
'gain': 'loss', 'gain': 'loss',
'leverage': 1.0, 'leverage': 1.0,
'order_rate': 1.099e-05,
'limit': 1.099e-05, 'limit': 1.099e-05,
'amount': 91.07468123, 'amount': 91.07468123,
'order_type': 'limit', 'order_type': 'limit',
@ -1744,7 +1747,7 @@ def test_send_msg_enter_notification(default_conf, mocker, caplog, message_type,
'exchange': 'Binance', 'exchange': 'Binance',
'pair': 'ETH/BTC', 'pair': 'ETH/BTC',
'leverage': leverage, 'leverage': leverage,
'limit': 1.099e-05, 'open_rate': 1.099e-05,
'order_type': 'limit', 'order_type': 'limit',
'direction': enter, 'direction': enter,
'stake_amount': 0.01465333, 'stake_amount': 0.01465333,
@ -1915,7 +1918,7 @@ def test_send_msg_sell_notification(default_conf, mocker) -> None:
'leverage': 1.0, 'leverage': 1.0,
'direction': 'Long', 'direction': 'Long',
'gain': 'loss', 'gain': 'loss',
'limit': 3.201e-05, 'order_rate': 3.201e-05,
'amount': 1333.3333333333335, 'amount': 1333.3333333333335,
'order_type': 'market', 'order_type': 'market',
'open_rate': 7.5e-05, 'open_rate': 7.5e-05,
@ -1950,7 +1953,7 @@ def test_send_msg_sell_notification(default_conf, mocker) -> None:
'pair': 'KEY/ETH', 'pair': 'KEY/ETH',
'direction': 'Long', 'direction': 'Long',
'gain': 'loss', 'gain': 'loss',
'limit': 3.201e-05, 'order_rate': 3.201e-05,
'amount': 1333.3333333333335, 'amount': 1333.3333333333335,
'order_type': 'market', 'order_type': 'market',
'open_rate': 7.5e-05, 'open_rate': 7.5e-05,
@ -1989,7 +1992,7 @@ def test_send_msg_sell_notification(default_conf, mocker) -> None:
'pair': 'KEY/ETH', 'pair': 'KEY/ETH',
'direction': 'Long', 'direction': 'Long',
'gain': 'loss', 'gain': 'loss',
'limit': 3.201e-05, 'order_rate': 3.201e-05,
'amount': 1333.3333333333335, 'amount': 1333.3333333333335,
'order_type': 'market', 'order_type': 'market',
'open_rate': 7.5e-05, 'open_rate': 7.5e-05,
@ -2162,7 +2165,7 @@ def test_send_msg_buy_notification_no_fiat(
'exchange': 'Binance', 'exchange': 'Binance',
'pair': 'ETH/BTC', 'pair': 'ETH/BTC',
'leverage': leverage, 'leverage': leverage,
'limit': 1.099e-05, 'open_rate': 1.099e-05,
'order_type': 'limit', 'order_type': 'limit',
'direction': enter, 'direction': enter,
'stake_amount': 0.01465333, 'stake_amount': 0.01465333,
@ -2205,7 +2208,7 @@ def test_send_msg_sell_notification_no_fiat(
'gain': 'loss', 'gain': 'loss',
'leverage': leverage, 'leverage': leverage,
'direction': direction, 'direction': direction,
'limit': 3.201e-05, 'order_rate': 3.201e-05,
'amount': 1333.3333333333335, 'amount': 1333.3333333333335,
'order_type': 'limit', 'order_type': 'limit',
'open_rate': 7.5e-05, 'open_rate': 7.5e-05,

View File

@ -3256,6 +3256,7 @@ def test_execute_trade_exit_up(default_conf_usdt, ticker_usdt, fee, ticker_usdt_
'pair': 'ETH/USDT', 'pair': 'ETH/USDT',
'gain': 'profit', 'gain': 'profit',
'limit': 2.0 if is_short else 2.2, 'limit': 2.0 if is_short else 2.2,
'order_rate': 2.0 if is_short else 2.2,
'amount': pytest.approx(amt), 'amount': pytest.approx(amt),
'order_type': 'limit', 'order_type': 'limit',
'buy_tag': None, 'buy_tag': None,
@ -3321,6 +3322,7 @@ def test_execute_trade_exit_down(default_conf_usdt, ticker_usdt, fee, ticker_usd
'leverage': 1.0, 'leverage': 1.0,
'gain': 'loss', 'gain': 'loss',
'limit': 2.2 if is_short else 2.01, '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, 'amount': pytest.approx(29.70297029) if is_short else 30.0,
'order_type': 'limit', 'order_type': 'limit',
'buy_tag': None, 'buy_tag': None,
@ -3405,6 +3407,7 @@ def test_execute_trade_exit_custom_exit_price(
'leverage': 1.0, 'leverage': 1.0,
'gain': profit_or_loss, 'gain': profit_or_loss,
'limit': limit, 'limit': limit,
'order_rate': limit,
'amount': pytest.approx(amount), 'amount': pytest.approx(amount),
'order_type': 'limit', 'order_type': 'limit',
'buy_tag': None, 'buy_tag': None,
@ -3476,6 +3479,7 @@ def test_execute_trade_exit_down_stoploss_on_exchange_dry_run(
'leverage': 1.0, 'leverage': 1.0,
'gain': 'loss', 'gain': 'loss',
'limit': 2.02 if is_short else 1.98, '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), 'amount': pytest.approx(29.70297029 if is_short else 30.0),
'order_type': 'limit', 'order_type': 'limit',
'buy_tag': None, 'buy_tag': None,
@ -3741,6 +3745,7 @@ def test_execute_trade_exit_market_order(
'leverage': 1.0, 'leverage': 1.0,
'gain': profit_or_loss, 'gain': profit_or_loss,
'limit': limit, 'limit': limit,
'order_rate': limit,
'amount': pytest.approx(amount), 'amount': pytest.approx(amount),
'order_type': 'market', 'order_type': 'market',
'buy_tag': None, 'buy_tag': None,