mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
* 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>
19 lines
699 B
Python
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"
|