fix: 上传二维码并发送 Ad Hoc 通知

This commit is contained in:
shenlei
2026-07-20 15:22:44 +09:00
parent 8c0bce45a4
commit 9b77441ec7
6 changed files with 190 additions and 5 deletions
+25
View File
@@ -50,3 +50,28 @@ def test_app_store_distribution_uploads_only_ipa(tmp_path):
assert uploaded_files[0][0].suffix == ".ipa"
assert download_url.endswith("100_2_0_0.ipa")
assert qr_path == ""
def test_adhoc_distribution_uploads_qrcode(tmp_path):
ipa = tmp_path / "source.ipa"
ipa.write_bytes(b"ad-hoc-ipa")
config = {
"APPID": "100",
"VERSION": "2.0.0",
"BUILD_TYPE": "Ad_Hoc",
"OSS_FLODER": "readoor",
"_upload_config": {"mode": "oss", "oss": {}},
}
def upload_files(_upload_config, files):
local_path, remote_path = files[0]
return {local_path.suffix: f"https://files.example.com/{remote_path}"}
with patch("backend.services.distribution._upload_oss", side_effect=upload_files) as upload:
download_url, qr_url = publish_ipa(config, ipa, tmp_path / "build")
assert download_url.endswith("100_2_0_0.html")
assert qr_url.endswith("100_2_0_0.png")
assert [call.args[1][0][0].suffix for call in upload.call_args_list] == [
".ipa", ".plist", ".html", ".png",
]