Spaces:
Running
Running
AuthorBot
Unify token tracking, smart links, and personality settings across admin and chat.
a825fee | """Suite D — Subscription budget enforcement (P0).""" | |
| import inspect | |
| import pytest | |
| from app.core.access import subscription as sub_mod | |
| from app.services import token_budget as token_budget_mod | |
| def test_record_token_usage_sets_budget_exhausted_at_limit(): | |
| """A-23 / G-03: record_token_usage sets budget_exhausted when at 100%.""" | |
| source = inspect.getsource(token_budget_mod.record_token_usage) | |
| assert "budget_exhausted" in source | |
| def test_subscription_validates_budget_exhausted_redis_key(): | |
| """D: Subscription layer checks budget_exhausted Redis key.""" | |
| source = inspect.getsource(sub_mod.validate_subscription_token) | |
| assert "budget_exhausted" in source | |