@@ -13,7 +13,7 @@ def __getattr__(cls, item):
1313# without its real heavy dependencies being present during unit-testing.
1414# ---------------------------------------------------------------------------
1515for module_path in [
16- "consts" , "consts.provider" , "consts.model" , "consts.const" ,
16+ "consts" , "consts.provider" , "consts.model" , "consts.const" , "consts.exceptions" ,
1717 "utils" , "utils.model_name_utils" ,
1818 "services" , "services.model_health_service" ,
1919 "database" , "database.model_management_db" ,
@@ -31,6 +31,7 @@ def __getattr__(cls, item):
3131# Mock ProviderEnum for get_provider_models tests
3232class _ProviderEnumStub :
3333 SILICON = mock .Mock (value = "silicon" )
34+ MODELENGINE = mock .Mock (value = "modelengine" )
3435
3536sys .modules ["consts.provider" ].ProviderEnum = _ProviderEnumStub
3637
@@ -42,6 +43,13 @@ class _EnumStub:
4243
4344sys .modules ["consts.model" ].ModelConnectStatusEnum = _EnumStub
4445
46+ # Mock exception classes
47+ class _TimeoutExceptionStub (Exception ):
48+ """Mock TimeoutException for testing."""
49+ pass
50+
51+ sys .modules ["consts.exceptions" ].TimeoutException = _TimeoutExceptionStub
52+
4553# Mock the database function that merge_existing_model_tokens depends on
4654sys .modules ["database.model_management_db" ].get_models_by_tenant_factory_type = mock .MagicMock ()
4755
0 commit comments