from pathlib import Path
import zipfile


ROOT = Path(__file__).resolve().parents[2]


def test_macos_click_installers_have_unix_execute_metadata():
    with zipfile.ZipFile(ROOT / "outputs" / "orc-local-installer.zip") as archive:
        for name in ("Install ORC Local macOS.command", "scripts/install_macos.sh"):
            info = archive.getinfo(name)
            mode = (info.external_attr >> 16) & 0o777

            assert info.create_system == 3
            assert mode == 0o755
