corrected tests
This commit is contained in:
parent
bd00f6de17
commit
c1c20e4d8a
@ -229,7 +229,7 @@ class Telegram(RPCHandler):
|
|||||||
message = (
|
message = (
|
||||||
f"{emoji} *{msg['exchange']}:* {'Bought' if is_fill else 'Buying'} {msg['pair']}"
|
f"{emoji} *{msg['exchange']}:* {'Bought' if is_fill else 'Buying'} {msg['pair']}"
|
||||||
f" (#{msg['trade_id']})\n"
|
f" (#{msg['trade_id']})\n"
|
||||||
)
|
)
|
||||||
message += f"*Buy Tag:* `{msg['buy_tag']}`\n" if msg.get('buy_tag', None) else ""
|
message += f"*Buy Tag:* `{msg['buy_tag']}`\n" if msg.get('buy_tag', None) else ""
|
||||||
message += f"*Amount:* `{msg['amount']:.8f}`\n"
|
message += f"*Amount:* `{msg['amount']:.8f}`\n"
|
||||||
|
|
||||||
@ -283,8 +283,8 @@ class Telegram(RPCHandler):
|
|||||||
else:
|
else:
|
||||||
msg['profit_extra'] = ''
|
msg['profit_extra'] = ''
|
||||||
msg['profit_extra'] = (
|
msg['profit_extra'] = (
|
||||||
f" ({msg['gain']}: {msg['profit_amount']:.8f} {msg['stake_currency']}"
|
f" ({msg['gain']}: {msg['profit_amount']:.8f} {msg['stake_currency']}"
|
||||||
f"{msg['profit_extra']})")
|
f"{msg['profit_extra']})")
|
||||||
is_fill = msg['type'] == RPCMessageType.SELL_FILL
|
is_fill = msg['type'] == RPCMessageType.SELL_FILL
|
||||||
is_sub_trade = msg.get('sub_trade')
|
is_sub_trade = msg.get('sub_trade')
|
||||||
is_sub_profit = msg['profit_amount'] != msg.get('cumulative_profit')
|
is_sub_profit = msg['profit_amount'] != msg.get('cumulative_profit')
|
||||||
@ -297,8 +297,8 @@ class Telegram(RPCHandler):
|
|||||||
cp_extra = f" / {cp_fiat:.3f} {msg['fiat_currency']}"
|
cp_extra = f" / {cp_fiat:.3f} {msg['fiat_currency']}"
|
||||||
else:
|
else:
|
||||||
cp_extra = ''
|
cp_extra = ''
|
||||||
cp_extra = f"*Cumulative Profit:* (`{msg['cumulative_profit']:.8f}" \
|
cp_extra = f"*Cumulative Profit:* (`{msg['cumulative_profit']:.8f} " \
|
||||||
f" {msg['stake_currency']}{cp_extra}`)\n"
|
f"{msg['stake_currency']}{cp_extra}`)\n"
|
||||||
else:
|
else:
|
||||||
cp_extra = ''
|
cp_extra = ''
|
||||||
message = (
|
message = (
|
||||||
|
@ -823,7 +823,8 @@ def test_rpc_forcesell(default_conf, ticker, fee, mocker) -> None:
|
|||||||
'side': 'sell',
|
'side': 'sell',
|
||||||
'amount': amount,
|
'amount': amount,
|
||||||
'remaining': amount,
|
'remaining': amount,
|
||||||
'filled': 0.0
|
'filled': 0.0,
|
||||||
|
'id': trade.orders[0].order_id
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
msg = rpc._rpc_forcesell('3')
|
msg = rpc._rpc_forcesell('3')
|
||||||
|
@ -2617,7 +2617,8 @@ def test_handle_cancel_exit_limit(mocker, default_conf_usdt, fee) -> None:
|
|||||||
close_date=arrow.utcnow().datetime,
|
close_date=arrow.utcnow().datetime,
|
||||||
sell_reason="sell_reason_whatever",
|
sell_reason="sell_reason_whatever",
|
||||||
)
|
)
|
||||||
order = {'remaining': 1,
|
order = {'id': "123456",
|
||||||
|
'remaining': 1,
|
||||||
'amount': 1,
|
'amount': 1,
|
||||||
'status': "open"}
|
'status': "open"}
|
||||||
reason = CANCEL_REASON['TIMEOUT']
|
reason = CANCEL_REASON['TIMEOUT']
|
||||||
@ -4963,7 +4964,7 @@ def test_position_adjust3(mocker, default_conf_usdt, fee, data) -> None:
|
|||||||
|
|
||||||
trade = Trade.query.first()
|
trade = Trade.query.first()
|
||||||
assert trade
|
assert trade
|
||||||
if idx < len(orders) - 1:
|
if idx < len(data) - 1:
|
||||||
assert trade.is_open is True
|
assert trade.is_open is True
|
||||||
assert trade.open_order_id is None
|
assert trade.open_order_id is None
|
||||||
assert trade.amount == result[0]
|
assert trade.amount == result[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user