feat: paginate KIS balance inquiries
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user