fix: persist uncertain cancel outcomes
This commit is contained in:
@@ -12,7 +12,11 @@ import httpx
|
||||
import pytest
|
||||
|
||||
from trex_core.adapters.broker.kis import KISBroker
|
||||
from trex_core.application.broker_port import BrokerBalanceError, OrderRequest
|
||||
from trex_core.application.broker_port import (
|
||||
BrokerBalanceError,
|
||||
CancelState,
|
||||
OrderRequest,
|
||||
)
|
||||
|
||||
_MOCK_URL = "https://openapivts.koreainvestment.com:29443"
|
||||
|
||||
@@ -179,15 +183,13 @@ def test_submit_transport_failure_blocks_automatic_duplicate(monkeypatch):
|
||||
assert ack.accepted is True
|
||||
assert ack.broker_order_id.startswith("submission-unknown:")
|
||||
assert ack.reason == "submit_outcome_unknown:ReadTimeout"
|
||||
assert (
|
||||
b.cancel_order(
|
||||
ack.broker_order_id,
|
||||
side="buy",
|
||||
symbol="005930",
|
||||
qty=4,
|
||||
)
|
||||
is False
|
||||
cancel = b.cancel_order(
|
||||
ack.broker_order_id,
|
||||
side="buy",
|
||||
symbol="005930",
|
||||
qty=4,
|
||||
)
|
||||
assert cancel.state is CancelState.UNKNOWN
|
||||
|
||||
|
||||
def test_submit_gateway_5xx_blocks_automatic_duplicate(monkeypatch):
|
||||
|
||||
Reference in New Issue
Block a user