Skip to content

Commit 6015f90

Browse files
author
jiangpeiling
committed
♻️ refactor image module.
1 parent 70bc174 commit 6015f90

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/backend/app/test_image_app.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
import pytest
44
from unittest.mock import patch, MagicMock, AsyncMock
55

6-
# Add the project root directory to sys.path
7-
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../..')))
6+
# Dynamically determine the backend path
7+
current_dir = os.path.dirname(os.path.abspath(__file__))
8+
backend_dir = os.path.abspath(os.path.join(current_dir, "../../../backend"))
9+
sys.path.append(backend_dir)
810

911
# Mock the consts.const module before importing the image_app module
1012
mock_const = MagicMock()

0 commit comments

Comments
 (0)