feat: refactor portfolio strategy references

This commit is contained in:
2026-04-03 08:16:07 +00:00
parent ebd4559939
commit 908068d9aa
14 changed files with 294 additions and 139 deletions
+4
View File
@@ -13,6 +13,7 @@ def _client_with_tokens() -> TestClient:
def test_read_route_requires_token(monkeypatch) -> None:
monkeypatch.setenv("PORTFOLIOHUB_DB_ENABLED", "false")
monkeypatch.setenv("PORTFOLIOHUB_READ_TOKENS", "read-token")
get_settings.cache_clear()
client = _client_with_tokens()
@@ -24,6 +25,7 @@ def test_read_route_requires_token(monkeypatch) -> None:
def test_read_route_accepts_read_token(monkeypatch) -> None:
monkeypatch.setenv("PORTFOLIOHUB_DB_ENABLED", "false")
monkeypatch.setenv("PORTFOLIOHUB_READ_TOKENS", "read-token")
get_settings.cache_clear()
client = _client_with_tokens()
@@ -35,6 +37,7 @@ def test_read_route_accepts_read_token(monkeypatch) -> None:
def test_trade_route_rejects_read_token(monkeypatch) -> None:
monkeypatch.setenv("PORTFOLIOHUB_DB_ENABLED", "false")
monkeypatch.setenv("PORTFOLIOHUB_READ_TOKENS", "read-token")
monkeypatch.setenv("PORTFOLIOHUB_TRADE_WRITE_TOKENS", "trade-token")
get_settings.cache_clear()
@@ -51,6 +54,7 @@ def test_trade_route_rejects_read_token(monkeypatch) -> None:
def test_admin_route_accepts_admin_token(monkeypatch) -> None:
monkeypatch.setenv("PORTFOLIOHUB_DB_ENABLED", "false")
monkeypatch.setenv("PORTFOLIOHUB_ADMIN_TOKENS", "admin-token")
get_settings.cache_clear()
client = _client_with_tokens()