Files
cutdex/tool/windows/test_check_windows_release.py
T
lingjhf 27e77fff39 feat: initial Cutdex application
Add the Flutter video editing application with project management, media
import, timeline editing, preview, AI assistance, diagnostics and settings.

Include shared UI and native host packages, platform runners, application
tests and release tooling.

Provide usage and contribution guides, the MIT license and third-party
notices. Exclude local credentials, build outputs and validation data.
2026-10-05 23:36:23 +08:00

47 lines
1.9 KiB
Python

import tempfile
import unittest
from pathlib import Path
from check_windows_release import REQUIRED, audit
class DependencyGateTest(unittest.TestCase):
def setUp(self):
self.temp = tempfile.TemporaryDirectory()
self.addCleanup(self.temp.cleanup)
self.root = Path(self.temp.name)
for name in REQUIRED:
path = self.root / name
path.parent.mkdir(parents=True, exist_ok=True)
path.touch()
(self.root / 'data/flutter_assets').mkdir()
def test_vc_runtime_in_another_worker_does_not_satisfy_app(self):
(self.root / 'processing/workers/asr/vcruntime140.dll').touch()
with self.assertRaisesRegex(ValueError, 'cutdex.exe -> vcruntime140.dll'):
audit(self.root, lambda p: ['vcruntime140.dll'] if p.name == 'cutdex.exe' else [])
def test_unknown_dependency_is_not_assumed_to_be_a_system_dll(self):
with self.assertRaisesRegex(ValueError, 'vendor.dll'):
audit(self.root, lambda p: ['vendor.dll'])
def test_local_runtime_and_inbox_api_sets_pass(self):
(self.root / 'VCRUNTIME140.dll').touch()
result = audit(self.root, lambda p: ['vcruntime140.dll', 'KERNEL32.dll',
'VERSION.dll', 'COMCTL32.dll', 'api-ms-win-crt-runtime-l1-1-0.dll'] if p.name == 'cutdex.exe' else [])
self.assertEqual(result['unresolved'], [])
self.assertFalse(result['cleanSystemValidated'])
def test_missing_flutter_aot_is_rejected(self):
(self.root / 'data/app.so').unlink()
with self.assertRaisesRegex(ValueError, 'data/app.so'):
audit(self.root, lambda p: [])
def test_jvm_is_not_assumed_to_be_a_system_dependency(self):
with self.assertRaisesRegex(ValueError, 'jvm.dll'):
audit(self.root, lambda p: ['jvm.dll'] if p.name == 'cutdex.exe' else [])
if __name__ == '__main__':
unittest.main()