test: freeze virtual recovery session clock
This commit is contained in:
@@ -17,6 +17,7 @@ from trex_core.domain.slot import SlotService, SlotState
|
||||
from trex_core.domain.slot.in_memory_repository import InMemorySlotRepository
|
||||
|
||||
KST = ZoneInfo("Asia/Seoul")
|
||||
VIRTUAL_AT = datetime(2026, 7, 29, 10, 0, tzinfo=KST)
|
||||
INSTANCE = "virtual-reliability"
|
||||
PORTFOLIO = "virtual-005930"
|
||||
SYMBOL = "005930"
|
||||
@@ -37,8 +38,8 @@ class _ExchangeState:
|
||||
"sll_buy_dvsn_cd": "02",
|
||||
"ord_qty": body["ORD_QTY"],
|
||||
"ord_unpr": body["ORD_UNPR"],
|
||||
"ord_dt": datetime.now(KST).strftime("%Y%m%d"),
|
||||
"ord_tmd": datetime.now(KST).strftime("%H%M%S"),
|
||||
"ord_dt": VIRTUAL_AT.strftime("%Y%m%d"),
|
||||
"ord_tmd": VIRTUAL_AT.strftime("%H%M%S"),
|
||||
"ord_gno_brno": "91258",
|
||||
"odno": f"{self.submit_attempts:010d}",
|
||||
"tot_ccld_qty": "0",
|
||||
@@ -124,6 +125,7 @@ def _broker(server: ThreadingHTTPServer) -> KISBroker:
|
||||
base_url=f"http://127.0.0.1:{server.server_port}",
|
||||
timeout=0.03,
|
||||
allow_live=True,
|
||||
clock=lambda: VIRTUAL_AT,
|
||||
)
|
||||
broker._headers = lambda _tr_id: {} # virtual exchange needs no credentials
|
||||
return broker
|
||||
|
||||
Reference in New Issue
Block a user