tests.test_binary module

Tests for repomatic.release.binary: the build roster and its asset names.

tests.test_binary.test_all_targets_present(target)[source]

All expected targets are in the mapping.

tests.test_binary.test_pack_binary_assets(tmp_path)[source]

Aliases are byte-identical copies; Python distributions are skipped.

tests.test_binary.test_binary_format_detection(tmp_path, payload, expected)[source]

Executable formats are recognized from their magic bytes.

tests.test_binary.ASSET_ARCH_LABELS = {Architecture(id='aarch64', name='ARM64 (AArch64)'): 'arm64', Architecture(id='x86_64', name='x86-64 (AMD64)'): 'x64'}

Short architecture spellings frozen into the published release-asset names.

BuildTarget.arch carries the canonical extra-platforms id (aarch64, x86_64), while every published download URL says arm64 or x64. This maps one onto the other, so a target key and its fields cannot drift apart.

tests.test_binary.test_nuitka_targets(target_id, build_target)[source]
Return type:

None

tests.test_binary.test_matrix_entry_is_json_safe(target_id, build_target)[source]

No extra-platforms trait may leak into the GitHub matrix.

build_targets and nuitka_matrix are serialized into the metadata JSON the release workflow reads, so an Architecture object reaching one of those dicts breaks the whole release lane at metadata time.

Return type:

None

tests.test_binary.test_enforced_floor_follows_binary_format(target_id, build_target)[source]

Only ELF and Mach-O record a floor a scan can measure.

A PE carries a nominal version header, so its declared floor stays documentation and verify_binary_floor has nothing to enforce. The format’s floor_label is what says which of the two a target is in.

Return type:

None

tests.test_binary.test_macos_compiles_without_ccache_at_its_floor(target_id, build_target)[source]

macOS turns ccache off, keeps no cache, and pins its deployment target.

Every other target adds no option and no variable, and keeps its cache.

Return type:

None

tests.test_binary.test_current_build_target(monkeypatch, platform, architecture, expected)[source]

The machine’s platform and architecture pick its target.

tests.test_binary.test_nuitka_enabled_default()[source]

Test that nuitka.enabled config defaults to True.

tests.test_binary.test_nuitka_disabled_skips_matrix(tmp_path, monkeypatch)[source]

nuitka_matrix is None when nuitka is disabled in pyproject.toml.