64 lines
1.9 KiB
Python
64 lines
1.9 KiB
Python
from pathlib import Path
|
|
import subprocess
|
|
|
|
|
|
INTEGRATION_ROOT = Path("integration/dxdesigner795")
|
|
|
|
|
|
def test_menu_is_ascii_portable_and_uses_795_menu_bar() -> None:
|
|
text = (INTEGRATION_ROOT / "MenuAdd.vbs").read_text(encoding="ascii")
|
|
|
|
assert 'DxToolsInstallMenuBar("Sheet Menu Bar")' in text
|
|
assert 'DxToolsInstallMenuBar("Main Menu Bar")' in text
|
|
assert "DxToolsResolveRoot" in text
|
|
assert "WScript.ScriptFullName" in text
|
|
assert "Scripting.CurrentScriptFullName" in text
|
|
assert "Scripting.ScriptFullName" in text
|
|
assert "DxDesignerTools.exe" in text
|
|
assert "DXTOOLS_HOME" not in text
|
|
assert "D:\\" not in text
|
|
assert text.isascii()
|
|
|
|
|
|
def test_menu_exposes_named_in_process_feature_actions() -> None:
|
|
text = (INTEGRATION_ROOT / "MenuAdd.vbs").read_text(encoding="ascii")
|
|
|
|
for action in (
|
|
"DxToolsOpenRefDes",
|
|
"DxToolsOpenPropertyChange",
|
|
"DxToolsOpenPropertyVisibility",
|
|
"DxToolsOpenInspection",
|
|
"DxToolsOpenBom",
|
|
"DxToolsOpenCompatibility",
|
|
"DxToolsOpenGuide",
|
|
):
|
|
assert f'OnAction = "{action}"' in text
|
|
assert "ExecuteGlobal" in text
|
|
assert "DxToolsStartFeature" in text
|
|
assert "LegacyMenu" not in text
|
|
|
|
|
|
def test_feature_menu_routes_through_design_bridge_entry() -> None:
|
|
text = (INTEGRATION_ROOT / "DesignBridge.vbs").read_text(encoding="ascii")
|
|
|
|
assert "DxToolsRunDesignBridge" in text
|
|
assert "DxToolsDesignBridgeStart" in text
|
|
assert "Snapshot.vbs" in text
|
|
assert "Transaction.vbs" in text
|
|
assert "Mailbox.vbs" in text
|
|
assert text.isascii()
|
|
|
|
|
|
def test_release_vbs_sources_are_ascii_only() -> None:
|
|
names = (
|
|
"MenuAdd.vbs",
|
|
"DesignBridge.vbs",
|
|
"BridgeCommon.vbs",
|
|
"CompatibilityProbe.vbs",
|
|
"core/Snapshot.vbs",
|
|
"core/Transaction.vbs",
|
|
"core/Mailbox.vbs",
|
|
)
|
|
for name in names:
|
|
assert (INTEGRATION_ROOT / name).read_bytes().isascii(), name
|