Merge branch 'develop' into enhancement/2668/refactored-winsparklepy

This commit is contained in:
David Sangrey authored and GitHub committed 2026-05-31 15:50:06 -04:00
commit b038e8a8dd
2 files changed
+16 -10

No files matched your search

+7 -2
View File
@@ -100,7 +100,12 @@ jobs:
#################################################################### ####################################################################
# Ensure all tests pass # Ensure all tests pass
#################################################################### ####################################################################
- name: PyTest tests - name: Install Virtual Framebuffer Dependecies
run: | run: |
pytest sudo apt-get update
sudo apt-get install -y xvfb python3-tk
- name: Run Tests with Virtual Display
run: |
xvfb-run --auto-servernum pytest
#################################################################### ####################################################################
+9 -8
View File
@@ -2,6 +2,7 @@
# mypy: ignore-errors # mypy: ignore-errors
"""Test the Updater.""" """Test the Updater."""
import sys
import pytest import pytest
import pathlib import pathlib
import hashlib import hashlib
@@ -144,12 +145,12 @@ class TestVersionChecking:
class TestWinSparkleInit: class TestWinSparkleInit:
@patch("sys.platform", "win32") @pytest.mark.skipif(sys.platform != "win32", reason="WinSparkle update logic is Windows-only")
@patch("ctypes.cdll.WinSparkle", create=True) def test_winsparkle_init_success(self):
def test_winsparkle_init_success(self, mock_ws):
"""Verify WinSparkle initialization logic on Windows.""" """Verify WinSparkle initialization logic on Windows."""
with patch("update.get_update_feed", return_value="http://feed"): with patch("ctypes.cdll.WinSparkle", create=True) as mock_ws:
with patch("update.appversion_nobuild", return_value="5.0.0"): with patch("update.get_update_feed", return_value="http://feed"):
updater = update.Updater(provider="external") with patch("update.appversion_nobuild", return_value="5.0.0"):
assert mock_ws.win_sparkle_init.called updater = update.Updater(provider="external")
assert mock_ws.win_sparkle_set_appcast_url.called assert mock_ws.win_sparkle_init.called
assert mock_ws.win_sparkle_set_appcast_url.called