(tmp_path)
| 918 | @pytest.mark.skipif(sys.platform != "darwin", reason="macOS only") |
| 919 | @pytest.mark.skipif(not shutil.which("xcodebuild"), reason="requires xcodebuild") |
| 920 | def test_example_osxpkg_extra_pages(tmp_path): |
| 921 | try: |
| 922 | subprocess.run(["xcodebuild", "--help"], check=True, capture_output=True) |
| 923 | except subprocess.CalledProcessError: |
| 924 | pytest.skip("xcodebuild requires XCode to compile extra pages.") |
| 925 | recipe_path = _example_path("osxpkg_extra_pages") |
| 926 | input_path = tmp_path / "input" |
| 927 | output_path = tmp_path / "output" |
| 928 | shutil.copytree(str(recipe_path), str(input_path)) |
| 929 | installer, install_dir = next(create_installer(input_path, output_path)) |
| 930 | # expand-full is an undocumented option that extracts all archives, |
| 931 | # including binary archives like the PlugIns file |
| 932 | cmd = ["pkgutil", "--expand-full", installer, output_path / "expanded"] |
| 933 | _execute(cmd) |
| 934 | installer_sections = output_path / "expanded" / "PlugIns" / "InstallerSections.plist" |
| 935 | assert installer_sections.exists() |
| 936 | |
| 937 | with open(installer_sections, "rb") as f: |
| 938 | plist = plist_load(f) |
| 939 | expected = { |
| 940 | "SectionOrder": [ |
| 941 | "Introduction", |
| 942 | "ReadMe", |
| 943 | "License", |
| 944 | "Target", |
| 945 | "PackageSelection", |
| 946 | "Install", |
| 947 | "ExtraPage.bundle", |
| 948 | ] |
| 949 | } |
| 950 | assert plist == expected |
| 951 | |
| 952 | |
| 953 | @pytest.mark.skipif(sys.platform != "darwin", reason="macOS only") |
nothing calls this directly
no test coverage detected