diff --git a/tests/router_unit_tests/test_router_index_management.py b/tests/router_unit_tests/test_router_index_management.py index 3d446841de3..0c313e9ef4e 100644 --- a/tests/router_unit_tests/test_router_index_management.py +++ b/tests/router_unit_tests/test_router_index_management.py @@ -2,6 +2,7 @@ import sys import os import pytest import ast +import ast sys.path.insert( 0, os.path.abspath("../..") @@ -179,14 +180,6 @@ class TestRouterIndexManagement: assert "claude-3" in router.model_name_to_deployment_indices assert router.model_name_to_deployment_indices["claude-3"] == [0] - def test_model_names_is_set(self): - """Verify that model_names uses a set for O(1) lookups, not a list (O(n))""" - router = Router(model_list=[]) - - assert isinstance(router.model_names, set), ( - f"model_names should be a set for O(1) lookups, but got {type(router.model_names)}" - ) - def test_no_linear_scans_in_router(self): """ Static analysis test to ensure Router doesn't use O(n) linear scans. @@ -273,3 +266,10 @@ class TestRouterIndexManagement: f"ALLOWED_METHODS in this test method.\n" f"{'='*70}\n" ) + def test_model_names_is_set(self): + """Verify that model_names uses a set for O(1) lookups, not a list (O(n))""" + router = Router(model_list=[]) + + assert isinstance(router.model_names, set), ( + f"model_names should be a set for O(1) lookups, but got {type(router.model_names)}" + )