修复福袋详情OCR v2与调试日志
This commit is contained in:
1 parent
2c6f024a24
commit
1d37d57c90
119 files changed
+5582
-767
No files matched your search
@@ -33,3 +33,34 @@ def test_web_gui_log_helper_does_not_raise():
|
||||
wg._wg_log("[smoke] info")
|
||||
wg._wg_log("[smoke] warn", level="WARNING")
|
||||
wg._wg_log("[smoke] error", level="ERROR")
|
||||
|
||||
|
||||
def test_cleanup_orphan_processes_filters_by_owned_pid(monkeypatch):
|
||||
import gui.web_gui as wg
|
||||
|
||||
runner = wg.ProcRunner()
|
||||
runner._owned_run_cli_pids = {111}
|
||||
|
||||
monkeypatch.setattr(
|
||||
runner,
|
||||
"_list_project_run_cli_processes",
|
||||
lambda: [
|
||||
(111, "python bin/run_cli.py --device-id A"),
|
||||
(222, "python bin/run_cli.py --device-id A"),
|
||||
],
|
||||
)
|
||||
|
||||
killed: list[list[str]] = []
|
||||
|
||||
def _fake_run(cmd, **kwargs): # noqa: ARG001
|
||||
killed.append(list(cmd))
|
||||
class _Result:
|
||||
returncode = 0
|
||||
return _Result()
|
||||
|
||||
monkeypatch.setattr(wg.subprocess, "run", _fake_run)
|
||||
|
||||
count = runner._cleanup_orphan_run_cli_processes("")
|
||||
|
||||
assert count == 0
|
||||
assert killed == []
|
||||
Reference in new issue
Block a user