chore(release): prepare v0.7.0

This commit is contained in:
Hermes Agent
2026-09-13 17:01:20 +09:00
parent 3569d864c9
commit adf131f19c
14 changed files with 145 additions and 14 deletions
@@ -94,7 +94,8 @@ def test_client_errors_are_permanent(status):
def test_outcome_parses_cash_quantity_after_on_new():
"""dcy-018 / REQ-017: option D authoritative cash/quantity from 201 response."""
def handler(request: httpx.Request) -> httpx.Response:
return httpx.Response(201, json={"cash_balance_after": 300000.0,
return httpx.Response(201, json={"status": "new",
"cash_balance_after": 300000.0,
"asset_quantity_after": 10})
out = PortfolioHubLedger("https://portfolio-hub.test", client=_client(handler)).record_trade(_trade())
@@ -102,12 +103,21 @@ def test_outcome_parses_cash_quantity_after_on_new():
assert out.cash_balance_after == 300000.0 and out.asset_quantity_after == 10.0
def test_outcome_parses_after_on_duplicate():
@pytest.mark.parametrize(
"duplicate_marker",
[
{"status": "duplicate"}, # portfolio-hub canonical response
{"duplicate": True}, # backward-compatible legacy response
],
)
def test_outcome_parses_after_on_duplicate(duplicate_marker):
"""duplicate(200) also carries current authoritative values (OQ-2 b)."""
def handler(request: httpx.Request) -> httpx.Response:
return httpx.Response(200, json={"duplicate": True,
"cash_balance_after": 50000.0,
"asset_quantity_after": 3})
return httpx.Response(200, json={
**duplicate_marker,
"cash_balance_after": 50000.0,
"asset_quantity_after": 3,
})
out = PortfolioHubLedger("https://portfolio-hub.test", client=_client(handler)).record_trade(_trade())
assert out.result is LedgerWriteResult.DUPLICATE_OK