feat: Add fallback mechanism for branded download selection when manifest is unavailable
This commit is contained in:
parent
1de604e7e2
commit
25ebe5d7ea
1 changed files with 34 additions and 0 deletions
|
|
@ -315,6 +315,40 @@ class TestDownloading:
|
||||||
assert result.name == "AgravityBridge-0.0.2-win-x64.msi"
|
assert result.name == "AgravityBridge-0.0.2-win-x64.msi"
|
||||||
mock_download.assert_called_once()
|
mock_download.assert_called_once()
|
||||||
|
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
async def test_download_update_falls_back_to_brand_prefix_without_manifest(
|
||||||
|
self, agravity_update_manager, tmp_path
|
||||||
|
):
|
||||||
|
"""Test branded download selection still works when the manifest is unavailable."""
|
||||||
|
release = Release(
|
||||||
|
tag_name="v0.0.2",
|
||||||
|
name="WebDropBridge v0.0.2",
|
||||||
|
version="0.0.2",
|
||||||
|
body="Release notes",
|
||||||
|
assets=[
|
||||||
|
{
|
||||||
|
"name": "WebDropBridge-0.0.2-win-x64.msi",
|
||||||
|
"browser_download_url": "https://example.com/WebDropBridge-0.0.2-win-x64.msi",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "AgravityBridge-0.0.2-win-x64.msi",
|
||||||
|
"browser_download_url": "https://example.com/AgravityBridge-0.0.2-win-x64.msi",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "AgravityBridge-0.0.2-win-x64.msi.sha256",
|
||||||
|
"browser_download_url": "https://example.com/AgravityBridge-0.0.2-win-x64.msi.sha256",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
published_at="2026-01-29T10:00:00Z",
|
||||||
|
)
|
||||||
|
|
||||||
|
with patch.object(UpdateManager, "_download_file", return_value=True) as mock_download:
|
||||||
|
result = await agravity_update_manager.download_update(release, tmp_path)
|
||||||
|
|
||||||
|
assert result is not None
|
||||||
|
assert result.name == "AgravityBridge-0.0.2-win-x64.msi"
|
||||||
|
mock_download.assert_called_once()
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_verify_checksum_uses_release_manifest(self, agravity_update_manager, tmp_path):
|
async def test_verify_checksum_uses_release_manifest(self, agravity_update_manager, tmp_path):
|
||||||
"""Test branded checksum selection from a shared release manifest."""
|
"""Test branded checksum selection from a shared release manifest."""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue