@@ -190,41 +190,42 @@ async def asyncTearDown(self):
190190 os .rmdir (os .path .join (root , name ))
191191 os .rmdir (test_path )
192192
193- async def _send_msg (self , msg : str , group_id : str = "test_group" ):
193+ async def _send_msg (self , msg : str , group_id : str = "test_group" , permission : int = 1 ):
194194 from core .communication import MessageMetaData , MessageSender
195195 meta = MessageMetaData (msg , msg , MessageSender ("user1" , "User" ), group_id , False )
196+ meta .permission = permission
196197 return await self .bot .process_message (msg , meta )
197198
198199 async def test_enable_disable (self ):
199- cmds = await self ._send_msg (".karma on" )
200+ cmds = await self ._send_msg (".karmadice on" )
200201 result = "\n " .join ([str (c ) for c in cmds ])
201202 self .assertIn ("开启" , result )
202203
203- cmds = await self ._send_msg (".karma off" )
204+ cmds = await self ._send_msg (".karmadice off" )
204205 result = "\n " .join ([str (c ) for c in cmds ])
205206 self .assertIn ("关闭" , result )
206207
207208 async def test_set_mode (self ):
208- await self ._send_msg (".karma on" )
209- cmds = await self ._send_msg (".karma mode hero" )
209+ await self ._send_msg (".karmadice on" )
210+ cmds = await self ._send_msg (".karmadice mode hero" )
210211 result = "\n " .join ([str (c ) for c in cmds ])
211- self .assertIn ("hero " , result . lower () )
212+ self .assertIn ("主角光环 " , result )
212213
213214 async def test_set_engine (self ):
214- await self ._send_msg (".karma on" )
215- cmds = await self ._send_msg (".karma engine precise" )
215+ await self ._send_msg (".karmadice on" )
216+ cmds = await self ._send_msg (".karmadice engine precise" )
216217 result = "\n " .join ([str (c ) for c in cmds ])
217218 self .assertIn ("精确" , result )
218219
219220 async def test_status (self ):
220- await self ._send_msg (".karma on" )
221- cmds = await self ._send_msg (".karma status" )
221+ await self ._send_msg (".karmadice on" )
222+ cmds = await self ._send_msg (".karmadice status" )
222223 result = "\n " .join ([str (c ) for c in cmds ])
223224 self .assertTrue (len (result ) > 0 )
224225
225226 async def test_reset_history (self ):
226- await self ._send_msg (".karma on" )
227+ await self ._send_msg (".karmadice on" )
227228 await self ._send_msg (".r" )
228- cmds = await self ._send_msg (".karma reset" )
229+ cmds = await self ._send_msg (".karmadice reset" )
229230 result = "\n " .join ([str (c ) for c in cmds ])
230231 self .assertIn ("清空" , result )
0 commit comments