1313import os
1414import shutil
1515import tempfile
16+ from pathlib import Path
1617from typing import Any , Dict , List
1718
1819import pytest
1920from fastapi .testclient import TestClient
2021from httpx import AsyncClient
2122
23+ from claude_code_api .core .config import settings
24+ from claude_code_api .core .session_manager import SessionManager
25+ from claude_code_api .main import app
26+ from claude_code_api .models .claude import get_available_models
27+ from tests .model_utils import get_test_model_id
28+
29+ PROJECT_ROOT = Path (__file__ ).parent .parent
30+ AVAILABLE_MODELS = get_available_models ()
31+ DEFAULT_MODEL = get_test_model_id ()
32+
2233
2334def parse_sse_events (body_text : str ) -> List [Dict [str , Any ]]:
2435 """Parse SSE events from a streaming response body."""
@@ -33,24 +44,6 @@ def parse_sse_events(body_text: str) -> List[Dict[str, Any]]:
3344 return events
3445
3546
36- # Import the FastAPI app
37- import sys
38- from pathlib import Path
39-
40- # Add project root to path
41- PROJECT_ROOT = Path (__file__ ).parent .parent
42- sys .path .insert (0 , str (PROJECT_ROOT ))
43-
44- from claude_code_api .core .config import settings
45- from claude_code_api .core .session_manager import SessionManager
46- from claude_code_api .main import app
47- from claude_code_api .models .claude import get_available_models
48- from tests .model_utils import get_test_model_id
49-
50- AVAILABLE_MODELS = get_available_models ()
51- DEFAULT_MODEL = get_test_model_id ()
52-
53-
5447class TestConfig :
5548 """Test configuration."""
5649
0 commit comments