feat(update): support verified public HTTP downloads
This commit is contained in:
@@ -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 = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user