@@ -61,8 +61,8 @@ def app(core_lifecycle_td: AstrBotCoreLifecycle):
6161def _resolve_dashboard_password (core_lifecycle_td : AstrBotCoreLifecycle ) -> str :
6262 """Return a login password compatible with both hashed and plain defaults."""
6363 password = core_lifecycle_td .astrbot_config ["dashboard" ]["password" ]
64- if isinstance (password , str ) and password .startswith ("pbkdf2_sha256$" ):
65- return "astrbot"
64+ if isinstance (password , str ) and ( password .startswith ("pbkdf2_sha256$" ) or password . startswith ( "$argon2" ) ):
65+ return "astrbot-test-password "
6666 return password
6767
6868
@@ -74,11 +74,12 @@ async def authenticated_header(app: Quart, core_lifecycle_td: AstrBotCoreLifecyc
7474 "/api/auth/login" ,
7575 json = {
7676 "username" : core_lifecycle_td .astrbot_config ["dashboard" ]["username" ],
77+
7778 "password" : _resolve_dashboard_password (core_lifecycle_td ),
7879 },
7980 )
8081 data = await response .get_json ()
81- assert data ["status" ] == "ok"
82+ assert data ["status" ] == "ok" , str ( data )
8283 token = data ["data" ]["token" ]
8384 return {"Authorization" : f"Bearer { token } " }
8485
@@ -98,6 +99,7 @@ async def test_auth_login(app: Quart, core_lifecycle_td: AstrBotCoreLifecycle):
9899 "/api/auth/login" ,
99100 json = {
100101 "username" : core_lifecycle_td .astrbot_config ["dashboard" ]["username" ],
102+
101103 "password" : _resolve_dashboard_password (core_lifecycle_td ),
102104 },
103105 )
@@ -142,11 +144,11 @@ async def fake_serve(app, config, shutdown_trigger):
142144 monkeypatch .setattr ("astrbot.dashboard.server.serve" , fake_serve )
143145 monkeypatch .setattr (
144146 "astrbot.dashboard.server.logger.warning" ,
145- lambda message : warning_messages .append (message ),
147+ lambda * args , ** kwargs : warning_messages .append (message ),
146148 )
147149 monkeypatch .setattr (
148150 "astrbot.dashboard.server.logger.info" ,
149- lambda message : info_messages .append (message ),
151+ lambda * args , ** kwargs : info_messages .append (message ),
150152 )
151153
152154 config = await server .run ()
@@ -1095,7 +1097,7 @@ async def _fake_sync_skills_to_active_sandboxes():
10951097 _fake_sync_skills_to_active_sandboxes ,
10961098 )
10971099 monkeypatch .setattr (
1098- "astrbot.core.skills.skill_manager .get_astrbot_data_path" ,
1100+ "astrbot.core.utils.astrbot_path .get_astrbot_data_path" ,
10991101 lambda : str (data_dir ),
11001102 )
11011103 monkeypatch .setattr (
0 commit comments