"""验证本地运行目录策略,不需要连接设备。""" from __future__ import annotations import sys from pathlib import Path import tempfile import unittest CLIENT_ROOT = Path(__file__).resolve().parents[1] sys.path.insert(0, str(CLIENT_ROOT / "src")) from cmbuyer_client.runtime import RuntimePaths class RuntimePathsTests(unittest.TestCase): def test_ensure_exists_creates_only_runtime_directories(self) -> None: with tempfile.TemporaryDirectory() as directory: paths = RuntimePaths.from_root(Path(directory) / "runtime") paths.ensure_exists() self.assertTrue(paths.logs.is_dir()) self.assertTrue(paths.artifacts.is_dir())