litellm/tests/unit/proxy/db/test_model_insights_tasks.py
devin-ai-integration[bot] 24584d3d3d
test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012)
* test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(proxy): keep tuple identity in proxy state restore and fix misc target paths

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: yuneng <yuneng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-01 18:14:24 +00:00

19 lines
699 B
Python

from litellm.proxy.db.model_insights_tasks import load_model_insight_tasks
from litellm.proxy.db.model_usage_rollup import model_usage_task_type
def test_every_task_has_a_label_and_a_category() -> None:
tasks = load_model_insight_tasks()
assert tasks
for name, task in tasks.items():
assert task.task_type == name
assert task.label
assert task.category in {"General", "Agent", "Code", "Data"}
def test_tasks_in_the_json_file_are_the_ones_the_rollup_accepts() -> None:
for name in load_model_insight_tasks():
assert model_usage_task_type(f'["task:{name}"]') == name
assert model_usage_task_type('["task:not_in_the_file"]') == "uncategorized"