Files
bearhub/tests/gems/flatpak/test_flatpak.py
Sebastian Palencsar 4a119968bc Release 0.10.7-bearhub.6
Complete M1 identity work, fix runtime URL regressions, repair the test
suite, add CI, migrate packaging/AppImage branding to Bearhub, and
document the Qt6/PySide6 migration plan.
2026-06-26 19:22:28 +02:00

24 lines
828 B
Python

from unittest import TestCase
from unittest.mock import patch, Mock
from bauh.gems.flatpak import flatpak, VERSION_1_2
class FlatpakTest(TestCase):
@patch("bauh.gems.flatpak.flatpak.SimpleProcess")
@patch("bauh.gems.flatpak.flatpak.ProcessHandler.handle_simple", return_value=(True, """
Looking for updates...
\tID\tArch\tBranch\tRemote\tDownload
1.\t \torg.xpto.Xnote\tx86_64\tstable\tflathub\t< 4.3 MB
"""))
def test_map_update_download_size__for_flatpak_1_2(self, SimpleProcess: Mock, handle_simple: Mock):
download_size = flatpak.map_update_download_size(app_ids={'org.xpto.Xnote'}, installation='user', version=VERSION_1_2)
SimpleProcess.assert_called_once()
handle_simple.assert_called_once()
self.assertEqual({'org.xpto.Xnote': 4300000}, download_size)