Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit b2bd4bc

Browse files
fix unit tests
1 parent 4a48941 commit b2bd4bc

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/codegate/db/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(self, sqlite_path: Optional[str] = None):
3131
)
3232
self._db_path = Path(sqlite_path).absolute()
3333
self._db_path.parent.mkdir(parents=True, exist_ok=True)
34-
logger.info(f"Initializing DB from path: {self._db_path}")
34+
logger.debug(f"Initializing DB from path: {self._db_path}")
3535
engine_dict = {
3636
"url": f"sqlite+aiosqlite:///{self._db_path}",
3737
"echo": False, # Set to False in production

tests/dashboard/test_post_processing.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ async def test_parse_output(output_dict, expected_str, expected_chat_id):
150150
@pytest.mark.asyncio
151151
@pytest.mark.parametrize("request_msg_str", ["Hello", None])
152152
@pytest.mark.parametrize("output_msg_str", ["Hello, how can I help you?", None])
153-
@pytest.mark.parametrize("chat_id", ["chatcmpl-AaQw9O1O2u360mhba5UbMoPwFgqEl", None])
153+
@pytest.mark.parametrize("chat_id", ["chatcmpl-AaQw9O1O2u360mhba5UbMoPwFgqEl"])
154154
@pytest.mark.parametrize(
155155
"row",
156156
[
@@ -181,12 +181,13 @@ async def test_parse_get_prompt_with_output(request_msg_str, output_msg_str, cha
181181
mock_parse_request.assert_called_once()
182182
mock_parse_output.assert_called_once()
183183

184-
if any([request_msg_str is None, output_msg_str is None, chat_id is None]):
184+
if request_msg_str is None:
185185
assert result is None
186186
else:
187187
assert result.question_answer.question.message == request_msg_str
188-
assert result.question_answer.answer.message == output_msg_str
189-
assert result.chat_id == chat_id
188+
if output_msg_str is not None:
189+
assert result.question_answer.answer.message == output_msg_str
190+
assert result.chat_id == chat_id
190191
assert result.provider == "provider"
191192
assert result.type == "chat"
192193
assert result.request_timestamp == timestamp_now

0 commit comments

Comments
 (0)