feat: refactor portfolio strategy references
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user