Skip to content

Commit d798f9b

Browse files
committed
♻️ Translate error messages and fix test cases
1 parent 7d90efa commit d798f9b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/backend/app/test_model_managment_app.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
import unittest
22
import pytest
3+
import os
4+
import sys
35
from unittest.mock import patch, MagicMock, AsyncMock
46

7+
# Add backend to Python path for imports
8+
current_dir = os.path.dirname(os.path.abspath(__file__))
9+
backend_dir = os.path.abspath(os.path.join(current_dir, "../../../backend"))
10+
if backend_dir not in sys.path:
11+
sys.path.insert(0, backend_dir)
12+
513
# Import FastAPI components only
614
from fastapi import FastAPI, APIRouter, Query, Body, Header, status
715
from fastapi.testclient import TestClient
@@ -860,8 +868,8 @@ def get_by_display_name_side_effect(display_name, tenant_id):
860868
@patch("test_model_managment_app.get_model_by_display_name")
861869
@patch("test_model_managment_app.delete_model_record")
862870
@patch("test_model_managment_app.get_models_by_tenant_factory_type")
863-
@patch("utils.model_name_utils.split_display_name")
864-
@patch("utils.model_name_utils.split_repo_name")
871+
@patch("backend.utils.model_name_utils.split_display_name")
872+
@patch("backend.utils.model_name_utils.split_repo_name")
865873
@patch("test_model_managment_app.get_current_user_id")
866874
def test_batch_create_models_max_tokens_update_called(self, mock_get_user, mock_split_repo, mock_split_display, mock_get_existing, mock_delete, mock_get_by_display, mock_prepare, mock_create, mock_update):
867875
"""Test that update_model_record is called when max_tokens differ"""

0 commit comments

Comments
 (0)