From c03d5f255ba8eda0af8d0dfe31fb10a98fdee417 Mon Sep 17 00:00:00 2001 From: Loren Eteval Date: Fri, 28 Aug 2026 07:53:40 +0800 Subject: [PATCH] test: isolate exit confirmation translation Signed-off-by: Loren Eteval --- tests/test_architecture_refactors.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/test_architecture_refactors.py b/tests/test_architecture_refactors.py index cf1d494..c75c700 100644 --- a/tests/test_architecture_refactors.py +++ b/tests/test_architecture_refactors.py @@ -795,25 +795,35 @@ class ApplicationLifecycleTransactionTest(TestCase): messageBoxType.StandardButton = AppQMessageBox.StandardButton mainWindow = mock.Mock() closeEvent = mock.Mock() + translatedQuestion = 'Translated exit question' application = SimpleNamespace( mainWindow=mainWindow, systemTray=None, exit=mock.Mock(), ) - with mock.patch( - 'Furious.Application.DesktopApplication.AppQMessageBox', - messageBoxType, + with ( + mock.patch( + 'Furious.Application.DesktopApplication.AppQMessageBox', + messageBoxType, + ), + mock.patch( + 'Furious.Application.DesktopApplication._', + return_value=translatedQuestion, + ) as translate, ): filtered = DesktopApplication._handleMainWindowCloseEvent( application, closeEvent, ) + translate.assert_called_once_with( + 'Are you sure you want to exit the application?' + ) messageBoxType.assert_called_once_with( icon=AppQMessageBox.Icon.Question, parent=mainWindow, - text='Are you sure you want to exit the application?', + text=translatedQuestion, buttons=( AppQMessageBox.StandardButton.Yes | AppQMessageBox.StandardButton.No ),