29 lines
1.2 KiB
Python
29 lines
1.2 KiB
Python
from pathlib import Path
|
|
|
|
def test_spec_uses_onedir_collect_and_product_name():
|
|
text=Path('packaging/CbbRefreshVerify.spec').read_text(encoding='utf-8')
|
|
assert 'COLLECT(' in text and 'CbbRefreshVerify' in text
|
|
|
|
def test_build_script_validates_executable():
|
|
text=Path('packaging/Build-CbbRefreshVerify.ps1').read_text(encoding='utf-8')
|
|
assert 'CbbRefreshVerify.exe' in text
|
|
|
|
def test_spec_packages_adaptive_dialog_rules_and_uia_modules():
|
|
text = Path('packaging/CbbRefreshVerify.spec').read_text(encoding='utf-8')
|
|
assert 'dialog_rules.v1.json' in text
|
|
assert 'pywinauto' in text
|
|
|
|
|
|
def test_spec_analysis_includes_pywin32_timezone_dynamic_import():
|
|
from types import SimpleNamespace
|
|
captured = {}
|
|
def analysis(*args, **kwargs):
|
|
captured.update(kwargs)
|
|
return SimpleNamespace(pure=[], scripts=[], binaries=[], zipfiles=[], datas=[])
|
|
path = Path('packaging/CbbRefreshVerify.spec')
|
|
namespace = {'SPECPATH': str(path.parent.resolve()), 'Analysis': analysis,
|
|
'PYZ': lambda *a, **k: None, 'EXE': lambda *a, **k: None,
|
|
'COLLECT': lambda *a, **k: None}
|
|
exec(compile(path.read_text(encoding='utf-8'), str(path), 'exec'), namespace)
|
|
assert 'win32timezone' in captured['hiddenimports']
|