mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Add test for no remaining
(kucoin case - https://github.com/freqtrade/freqtrade/issues/7757).
This commit is contained in:
parent
48e5a45856
commit
1975e942d6
|
@ -156,9 +156,25 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None:
|
|||
'filled': 0.0,
|
||||
'remaining': 91.07468123
|
||||
})
|
||||
|
||||
assert results[0] == response_unfilled
|
||||
|
||||
# Open order without remaining
|
||||
trade = Trade.get_open_trades()[0]
|
||||
# kucoin case (no remaining set).
|
||||
trade.orders[0].remaining = None
|
||||
Trade.commit()
|
||||
|
||||
results = rpc._rpc_trade_status()
|
||||
# Reuse above object, only remaining changed.
|
||||
response_unfilled['orders'][0].update({
|
||||
'remaining': None
|
||||
})
|
||||
assert results[0] == response_unfilled
|
||||
|
||||
trade = Trade.get_open_trades()[0]
|
||||
trade.orders[0].remaining = trade.amount
|
||||
Trade.commit()
|
||||
|
||||
# Fill open order ...
|
||||
freqtradebot.manage_open_orders()
|
||||
trades = Trade.get_open_trades()
|
||||
|
|
Loading…
Reference in New Issue
Block a user