feat: paginate KIS balance inquiries

This commit is contained in:
Hermes Agent
2026-08-10 00:11:04 +09:00
parent 701fb06362
commit 0fa8f39be9
6 changed files with 297 additions and 37 deletions
+16
View File
@@ -92,6 +92,22 @@ def test_strategy_quantity_above_raw_broker_total_fails_closed(tmp_path):
assert exc.value.code == "ownership_mismatch"
def test_projection_includes_strategy_symbol_alongside_first_page_manual_holding(tmp_path):
store = StrategyOwnershipStore(tmp_path / "ownership.json")
store.apply_fill(
execution_id="buy-1",
symbol="000660",
side="buy",
quantity=4,
)
broker = OwnershipAwareBroker(
FakeBroker([BalanceItem("005930", 19), BalanceItem("000660", 4)]),
store,
)
assert broker.get_balance() == [BalanceItem("000660", 4)]
def test_sell_cannot_reduce_below_strategy_owned_zero(tmp_path):
store = StrategyOwnershipStore(tmp_path / "ownership.json")
with pytest.raises(BrokerBalanceError):