kimi
|
a7da45e788
|
test: Add comprehensive unit tests for models/budget.py (#1316)
Tests / lint (pull_request) Failing after 39s
Tests / test (pull_request) Has been skipped
Fixes #1316
Adds 58 unit tests covering:
- SpendRecord dataclass functionality
- estimate_cost_usd() for all model types (Claude, GPT-4o, Grok)
- BudgetTracker initialization with memory/file DB
- Budget tracking and accumulation
- Daily/monthly spend queries and isolation
- Cloud budget limit enforcement (daily, monthly, both)
- Budget summary generation with all status flags
- In-memory fallback when DB is unavailable
- Thread-safe concurrent spend recording
- Edge cases: zero/negative costs, empty names, very small/large values
- Singleton get_budget_tracker() behavior
|
2026-03-23 22:47:55 -04:00 |
|