驱动点击兜底 + 队名可配置;补 11-15 实机记录
- driver_input: 只在"原地连点"(与上次点击相差<=4px)时先挪开 10px 再点, 强制产生 MOUSEMOVE; 按下 60→100ms, 到位等待 50→80ms (LCP_DRIVER_PRESS_MS / SETTLE_MS / WIGGLE 可调) - aalc_patches: 「获得E.G.O饰品」弹窗第 3 次起绕过驱动代理改软件点击(pyautogui), 第 8 次发回车, 20 次才中止; 新增 data/team_names.json 覆盖体系默认队名 (LCP_TEAM_NAMES=0 关闭) - docs: 2026-11-15 实测(6 连刷 6/6、键盘 4/4 进入、卡包按体系、镜像迷宫+震颤), ISSUES 状态更新 + I-14 前台被抢 单测: 709 passed。
This commit is contained in:
@@ -616,3 +616,49 @@ class EnterSwitchTest(unittest.TestCase):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
||||||
|
class TeamNamesFileTest(unittest.TestCase):
|
||||||
|
|
||||||
|
def _write(self, data):
|
||||||
|
import json
|
||||||
|
import tempfile
|
||||||
|
fh = tempfile.NamedTemporaryFile('w', suffix='.json', delete=False, encoding='utf-8')
|
||||||
|
json.dump(data, fh, ensure_ascii=False)
|
||||||
|
fh.close()
|
||||||
|
self.addCleanup(lambda: os.unlink(fh.name))
|
||||||
|
return fh.name
|
||||||
|
|
||||||
|
def test_reads_overrides(self):
|
||||||
|
path = self._write({'_说明': ['x'], 'tremor': ['镜像迷宫', '震颤']})
|
||||||
|
self.assertEqual(aalc_patches.load_team_names(path, log=lambda *_: None),
|
||||||
|
{'tremor': ('镜像迷宫', '震颤')})
|
||||||
|
|
||||||
|
def test_bad_file_falls_back_to_empty(self):
|
||||||
|
path = self._write(['not', 'a', 'dict'])
|
||||||
|
self.assertEqual(aalc_patches.load_team_names(path, log=lambda *_: None), {})
|
||||||
|
|
||||||
|
def test_missing_file_falls_back_to_empty(self):
|
||||||
|
self.assertEqual(
|
||||||
|
aalc_patches.load_team_names(os.path.join(os.path.dirname(__file__), 'no-such.json'),
|
||||||
|
log=lambda *_: None), {})
|
||||||
|
|
||||||
|
def test_override_goes_first_then_defaults(self):
|
||||||
|
path = self._write({'tremor': ['镜像迷宫']})
|
||||||
|
module = types.ModuleType('tasks.mirror.mirror')
|
||||||
|
module.Mirror = _FakeMirror
|
||||||
|
module.select_battle_team = lambda num: True
|
||||||
|
auto_mod = types.ModuleType('module.automation')
|
||||||
|
auto_mod.auto = mock.Mock()
|
||||||
|
tasks_pkg = types.ModuleType('tasks'); tasks_pkg.__path__ = []
|
||||||
|
mirror_pkg = types.ModuleType('tasks.mirror'); mirror_pkg.__path__ = []
|
||||||
|
mirror_pkg.mirror = module
|
||||||
|
with mock.patch.dict(sys.modules, {'tasks': tasks_pkg, 'tasks.mirror': mirror_pkg,
|
||||||
|
'tasks.mirror.mirror': module,
|
||||||
|
'module': types.ModuleType('module'),
|
||||||
|
'module.automation': auto_mod}):
|
||||||
|
aalc_patches.install_system_team_selection(log=lambda *_: None,
|
||||||
|
env={'LCP_TEAM_NAMES': path})
|
||||||
|
module.Mirror({'system': 'tremor'}, 1)
|
||||||
|
with mock.patch.object(aalc_patches, '_select_team_by_name', return_value=True) as sel:
|
||||||
|
module.select_battle_team(1)
|
||||||
|
self.assertEqual(sel.call_args[0][1], ('镜像迷宫', '震颤'))
|
||||||
Reference in New Issue
Block a user