def test_disabled_progress_reporting(self): """Test a callback with disabled progress reporting.""" flatpak = FlatpakManager(sysroot="remote/path") flatpak._operation_started_callback( transaction=Mock(), operation=OperationMock(), progress=Mock(), )
def test_operation_started_callback(self): """Test the callback for started operations.""" progress = Mock() flatpak = FlatpakManager(sysroot="remote/path", callback=progress) with self.assertLogs(level="DEBUG") as cm: flatpak._operation_started_callback( transaction=Mock(), operation=OperationMock("app/org.test"), progress=Mock(), ) progress.assert_called_once_with("Installing app/org.test") msg = "Flatpak operation: install of ref app/org.test state started" assert msg in "\n".join(cm.output)