feat: 内置并统一使用项目 ADB (#149)

This commit is contained in:
chengma
2026-08-11 12:01:07 +08:00
parent 56b1a46c5c
commit 8f2037db2f
21 changed files with 355 additions and 46 deletions
+21 -1
View File
@@ -21,7 +21,7 @@ from build_tools.release_manifest import (
versioned_manifest_file_name,
write_manifest,
)
from src.db import data_dir
from src.db import app_dir, data_dir
class LauncherPathTest(unittest.TestCase):
@@ -139,6 +139,26 @@ class PackagedDataPathTest(unittest.TestCase):
):
self.assertEqual(data_dir(), root / "data")
def test_packaged_resource_path_uses_pyinstaller_directory(self):
with tempfile.TemporaryDirectory() as directory, patch(
"src.db.sys.frozen", True, create=True
), patch("src.db.sys._MEIPASS", directory, create=True):
self.assertEqual(app_dir(), Path(directory).resolve())
class BundledAdbPackagingTest(unittest.TestCase):
def test_build_script_packages_and_checks_all_adb_files(self):
client_root = Path(__file__).resolve().parents[1]
script = (client_root / "packaging" / "build.ps1").read_text(
encoding="utf-8-sig"
)
self.assertIn("--add-binary", script)
self.assertIn("vendor/android-platform-tools/windows", script)
self.assertIn("adb.exe", script)
self.assertIn("AdbWinApi.dll", script)
self.assertIn("AdbWinUsbApi.dll", script)
class ReleaseManifestTest(unittest.TestCase):
def test_manifest_name_and_hash_match_release_files(self):