Skip to content

Commit cbea6f8

Browse files
committed
⭐️ ModelEngine Models Interrogation
1 parent 5128bf8 commit cbea6f8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/backend/services/test_model_provider_service.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def __getattr__(cls, item):
1313
# without its real heavy dependencies being present during unit-testing.
1414
# ---------------------------------------------------------------------------
1515
for 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
3232
class _ProviderEnumStub:
3333
SILICON = mock.Mock(value="silicon")
34+
MODELENGINE = mock.Mock(value="modelengine")
3435

3536
sys.modules["consts.provider"].ProviderEnum = _ProviderEnumStub
3637

@@ -42,6 +43,13 @@ class _EnumStub:
4243

4344
sys.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
4654
sys.modules["database.model_management_db"].get_models_by_tenant_factory_type = mock.MagicMock()
4755

0 commit comments

Comments
 (0)