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
+30
View File
@@ -0,0 +1,30 @@
import subprocess
import sys
import tomllib
from pathlib import Path
from trex_core import __version__
ROOT = Path(__file__).resolve().parents[1]
def test_runtime_version_matches_project_metadata():
project = tomllib.loads((ROOT / "pyproject.toml").read_text())
assert __version__ == project["project"]["version"]
def test_all_console_modules_display_the_release_version():
for module, command in (
("trex_core.runtime.cli", "trex-core"),
("trex_core.runtime.daemon", "trex-core-daemon"),
("trex_core.runtime.reset", "trex-core-reset"),
):
result = subprocess.run(
[sys.executable, "-m", module, "--version"],
cwd=ROOT,
check=True,
capture_output=True,
text=True,
)
assert result.stdout.strip() == f"{command} {__version__}"