修复福袋详情OCR v2与调试日志

This commit is contained in:
Your Name committed 2026-06-03 01:22:13 +08:00
1 parent 2c6f024a24
commit 1d37d57c90
119 files changed
+5582 -767

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
from __future__ import annotations
from pathlib import Path
def test_stop_old_processes_targets_current_repo_only(monkeypatch):
import gui.webgui_launcher as launcher
inst = launcher.WebGUILauncher.__new__(launcher.WebGUILauncher)
logs: list[str] = []
inst.log = logs.append
calls: list[list[str]] = []
def _fake_run(cmd, **kwargs): # noqa: ARG001
calls.append(list(cmd))
class _Result:
returncode = 0
return _Result()
monkeypatch.setattr(launcher.sys, "platform", "win32")
monkeypatch.setattr(launcher.subprocess, "run", _fake_run)
inst.stop_old_processes()
assert calls, "expected stop_old_processes to invoke subprocess.run"
ps_cmd = " ".join(calls[0])
expected_root = str(Path(launcher.PROJECT_ROOT)).replace("\\", "\\\\")
assert expected_root.lower() in ps_cmd.lower()