Skip to content

Commit

Permalink
test: Update test cases for memory composition and authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
lss233 committed Feb 23, 2025
1 parent b479bee commit 552ac3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/memory/test_composer_decomposer.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_compose_llm_response(self, composer, c2c_sender):

entry = composer.compose(c2c_sender, [chat_message])

assert f"<@LLM> 说: {chat_message.content}" in entry.content
assert f"你回答: {chat_message.content}" in entry.content
assert isinstance(entry.timestamp, datetime)


Expand Down
5 changes: 3 additions & 2 deletions tests/web/auth/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import pytest
import pytest_asyncio

from kirara_ai.config.global_config import GlobalConfig, WebConfig
from kirara_ai.ioc.container import DependencyContainer
from kirara_ai.web.app import create_app
from tests.utils.auth_test_utils import TEST_PASSWORD, setup_auth_service
Expand All @@ -18,6 +19,7 @@ def app():
"""创建测试应用实例"""
container = DependencyContainer()
setup_auth_service(container)
container.register(GlobalConfig, GlobalConfig(web=WebConfig(secret_key=TEST_SECRET_KEY)))
return create_app(container)


Expand Down Expand Up @@ -122,7 +124,6 @@ async def test_change_password_wrong_old(self, test_client, auth_token):
json={"old_password": "wrong-password", "new_password": TEST_NEW_PASSWORD},
headers={"Authorization": f"Bearer {auth_token}"},
)

assert response.status_code == 401

data = await response.get_json()
assert "error" in data

0 comments on commit 552ac3a

Please sign in to comment.