mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
test(routing_groups): cover selector build failure returning the error
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
eac63695d5
commit
d3ff68f0c3
1 changed files with 12 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ import sys
|
|||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from pydantic import ValidationError
|
||||
|
||||
sys.path.insert(0, os.path.abspath("../.."))
|
||||
|
||||
|
|
@ -815,3 +816,14 @@ def test_unbuildable_group_selector_keeps_previous_groups():
|
|||
assert router._model_to_group == {"filtered-model": "g1"}
|
||||
assert router._group_selectors["g1"]["latency-based-routing"] is selector
|
||||
assert sum(1 for cb in litellm.callbacks if type(cb) is type(selector)) == 1
|
||||
assert isinstance(
|
||||
router._try_build_group_selector(
|
||||
RoutingGroup(
|
||||
group_name="g2",
|
||||
models=["other-model"],
|
||||
routing_strategy="latency-based-routing",
|
||||
routing_strategy_args={"ttl": "not-a-number"},
|
||||
)
|
||||
),
|
||||
ValidationError,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue