@@ -35,9 +35,10 @@ async def test_on_order_refresh_successful(sell_limit_order):
35
35
sell_limit_order .clear ()
36
36
37
37
38
- async def test_constructor_with_pending_cancel_status (buy_limit_order ):
38
+ async def test_constructor_real_order_with_pending_cancel_status (buy_limit_order ):
39
39
# with PENDING_CANCEL status
40
40
buy_limit_order .status = enums .OrderStatus .PENDING_CANCEL
41
+ buy_limit_order .simulated = False
41
42
state = octobot_trading .personal_data .CancelOrderState (buy_limit_order , True )
42
43
assert state .state is enums .OrderStates .CANCELING
43
44
assert state .is_pending ()
@@ -47,6 +48,18 @@ async def test_constructor_with_pending_cancel_status(buy_limit_order):
47
48
assert not state .is_status_cancelled ()
48
49
49
50
51
+ async def test_constructor_simulated_order_with_pending_cancel_status (buy_limit_order ):
52
+ buy_limit_order .status = enums .OrderStatus .PENDING_CANCEL
53
+ buy_limit_order .simulated = True
54
+ state = octobot_trading .personal_data .CancelOrderState (buy_limit_order , True )
55
+ assert state .state is enums .OrderStates .CANCELED
56
+ assert not state .is_pending ()
57
+ assert state .is_canceled ()
58
+ if not os .getenv ('CYTHON_IGNORE' ):
59
+ assert not state .is_status_pending ()
60
+ assert state .is_status_cancelled ()
61
+
62
+
50
63
async def test_constructor_with_cancelled_status (sell_limit_order ):
51
64
# with CANCELED status
52
65
sell_limit_order .status = enums .OrderStatus .CANCELED
0 commit comments