20 lines
810 B
Python
20 lines
810 B
Python
from datetime import datetime
|
|
|
|
from app.db import universe_audit
|
|
|
|
|
|
def test_universe_reason_ttl_tiers():
|
|
now = datetime(2026, 5, 25, 12, 0, 0)
|
|
|
|
assert universe_audit.reason_type_for("stablecoin") == "static"
|
|
assert universe_audit.reason_type_for("stale_ticker") == "transient"
|
|
assert universe_audit.reason_type_for("low_turnover") == "dynamic"
|
|
|
|
static_expiry = datetime.fromisoformat(universe_audit.expires_at_for("static", now))
|
|
transient_expiry = datetime.fromisoformat(universe_audit.expires_at_for("transient", now))
|
|
dynamic_expiry = datetime.fromisoformat(universe_audit.expires_at_for("dynamic", now))
|
|
|
|
assert (static_expiry - now).days == 90
|
|
assert int((transient_expiry - now).total_seconds()) == 3600
|
|
assert int((dynamic_expiry - now).total_seconds()) == 21600
|