def METHOD_NAME(mock_tools, tmp_path):
    """If the download archive is corrupted, the validator fails."""
    # Create a mock of a previously installed WiX version.
    wix_path = tmp_path / "tools" / "wix"
    wix_path.mkdir(parents=True)
    (wix_path / "heat.exe").touch()
    (wix_path / "light.exe").touch()
    (wix_path / "candle.exe").touch()
    # Mock the download
    wix_zip_path = os.fsdecode(tmp_path / "tools" / "wix.zip")
    wix_zip = MagicMock()
    wix_zip.__fspath__.return_value = wix_zip_path
    mock_tools.download.file.return_value = wix_zip
    # Mock an unpack failure
    mock_tools.shutil.unpack_archive.side_effect = EOFError
    # Create an SDK wrapper
    wix = WiX(mock_tools, wix_home=wix_path, bin_install=True)
    # Upgrade the install. This will trigger a download,
    # but the unpack will fail.
    with pytest.raises(BriefcaseCommandError):
        wix.upgrade()
    # A download was initiated
    mock_tools.download.file.assert_called_with(
        url=WIX_DOWNLOAD_URL,
        download_path=tmp_path / "tools",
        role="WiX",
    )
    # The download was unpacked.
    mock_tools.shutil.unpack_archive.assert_called_with(
        os.fsdecode(wix_zip_path), extract_dir=os.fsdecode(wix_path)
    )
    # The zip file was not removed
    assert wix_zip.unlink.call_count == 0