chore: import upstream snapshot with attribution
Tests / Import Check (Python 3.13) (push) Has been cancelled
Tests / Import Check (Python 3.14) (push) Has been cancelled
Tests / Python Tests (Python 3.11) (push) Has been cancelled
Tests / Python Tests (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.14) (push) Has been cancelled
Tests / Test Summary (push) Has been cancelled
Tests / Lint and Format (push) Has been cancelled
Tests / Web Node Tests (push) Has been cancelled
Tests / Import Check (Python 3.11) (push) Has been cancelled
Tests / Import Check (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.13) (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 13:00:43 +08:00
commit e4dcfc49aa
1668 changed files with 324490 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
from __future__ import annotations
import importlib.util
from pathlib import Path
from unittest import mock
def _load_module():
module_path = Path(__file__).resolve().parents[2] / "scripts" / "start_web.py"
spec = importlib.util.spec_from_file_location("start_web_under_test", module_path)
assert spec and spec.loader
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module
def test_start_web_parser_supports_home(tmp_path: Path) -> None:
start_web = _load_module()
args = start_web.build_parser().parse_args(["--home", str(tmp_path)])
assert args.home == tmp_path
def test_start_web_delegates_to_runtime_launcher(tmp_path: Path) -> None:
start_web = _load_module()
with mock.patch.object(start_web, "start") as start:
start_web.main(["--home", str(tmp_path)])
start.assert_called_once_with(home=tmp_path)