feat(update): support verified public HTTP downloads

This commit is contained in:
chengma
2026-07-13 16:19:03 +08:00
parent 9a458ee195
commit 74b98cd123
8 changed files with 234 additions and 37 deletions
+31
View File
@@ -1739,6 +1739,37 @@ class GuiTests(TempDirMixin, unittest.TestCase):
self.assertEqual("重试", dialog.action_button.text())
self.assertIsNone(dialog.thread)
def test_forced_update_dialog_only_warns_for_plain_http_download(self):
common = {
"current_version": "1.0.0",
"checked": True,
"forced": True,
"latest_version": "1.2.0",
"sha256": "a" * 64,
"size_bytes": 100,
"package_format": "cmshopee-portable-v1",
"updater_protocol": 1,
"min_updater_protocol": 1,
}
http_dialog = ForcedUpdateDialog(
update_check.UpdateCheckResult(
download_url="http://external.example.test/cmshopee.zip",
**common,
)
)
https_dialog = ForcedUpdateDialog(
update_check.UpdateCheckResult(
download_url="https://external.example.test/cmshopee.zip",
**common,
)
)
self.addCleanup(http_dialog.close)
self.addCleanup(https_dialog.close)
self.assertFalse(http_dialog.http_warning_label.isHidden())
self.assertIn("临时 HTTP 通道", http_dialog.http_warning_label.text())
self.assertTrue(https_dialog.http_warning_label.isHidden())
def test_startup_update_gate_fuses_a_previously_failed_release(self):
captured = []