Kyryll Kochkin commited on
Commit
2673d1c
·
1 Parent(s): a89347b

AI fixes tests

Browse files
tests/test_core_helpers.py CHANGED
@@ -1,10 +1,16 @@
1
  """Unit tests for prompt/token/engine helper utilities."""
2
  from __future__ import annotations
3
 
 
4
  import types
 
5
 
6
  import pytest
7
 
 
 
 
 
8
  from app.core import engine, tokens
9
  from app.core.prompting import DEFAULT_SYSTEM_PROMPT, render_chat_prompt
10
  from app.schemas.chat import ChatMessage
 
1
  """Unit tests for prompt/token/engine helper utilities."""
2
  from __future__ import annotations
3
 
4
+ import sys
5
  import types
6
+ from pathlib import Path
7
 
8
  import pytest
9
 
10
+ ROOT = Path(__file__).resolve().parents[1]
11
+ if str(ROOT) not in sys.path:
12
+ sys.path.insert(0, str(ROOT))
13
+
14
  from app.core import engine, tokens
15
  from app.core.prompting import DEFAULT_SYSTEM_PROMPT, render_chat_prompt
16
  from app.schemas.chat import ChatMessage
tests/test_main_behavior.py CHANGED
@@ -3,10 +3,16 @@ from __future__ import annotations
3
 
4
  import asyncio
5
  import json
 
 
6
 
7
  from fastapi import HTTPException
8
  from starlette.requests import Request
9
 
 
 
 
 
10
  from app import main
11
 
12
 
 
3
 
4
  import asyncio
5
  import json
6
+ import sys
7
+ from pathlib import Path
8
 
9
  from fastapi import HTTPException
10
  from starlette.requests import Request
11
 
12
+ ROOT = Path(__file__).resolve().parents[1]
13
+ if str(ROOT) not in sys.path:
14
+ sys.path.insert(0, str(ROOT))
15
+
16
  from app import main
17
 
18