import importlib.util spec=importlib.util.spec_from_file_location('srv','/var/minis/workspace/drinking-games-ui/server.py') srv=importlib.util.module_from_spec(spec); spec.loader.exec_module(srv) room, host=srv.create_room('dice','房主','p-host') for _ in range(2): srv.add_bot(room['code'],'p-host') srv.start_room(room['code'],'p-host') # 模拟上一手:4个4斋 room['currentCall']={'count':4,'point':4,'mode':'斋','by':'Mia','byId':'bot'} room['turnIndex']=0 srv.call_dice(room['code'],'p-host',5,2) print('5x2 after 4x4', room['currentCall']) assert room['currentCall']['mode']=='斋' room['currentCall']={'count':4,'point':4,'mode':'斋','by':'Mia','byId':'bot'} room['turnIndex']=0 srv.call_dice(room['code'],'p-host',8,2) print('8x2 after 4x4', room['currentCall']) assert room['currentCall']['mode']=='飞'