diff --git a/test/test_resolution_smoke_test.py b/test/test_resolution_smoke_test.py index d0916125b0f299a77235bfc6fc548af6430aea2b..03f108bc5a5312ff9f369b42426ba00612eaf162 100644 --- a/test/test_resolution_smoke_test.py +++ b/test/test_resolution_smoke_test.py @@ -13,6 +13,7 @@ from PySide2.QtWidgets import QApplication from PySide2 import QtGui from PySide2.QtCore import QTimer, Qt from PySide2.QtTest import QTest +from PySide2.QtGui import QGuiApplication from soitool.soi import SOI from soitool.modules.module_authentication_board import ( AuthenticationBoardModule, @@ -26,6 +27,43 @@ else: app = QtGui.qApp +def screen_information(): + """Get string with information about the screen. + + Returns + ------- + str + String with screen information. + """ + screen_string = "" + screen = QGuiApplication.primaryScreen() + screen_string += "screen.size() -> " + str(screen.size()) + "\n" + screen_string += ( + "screen.physicalDotsPerInchX() -> " + + str(screen.physicalDotsPerInchX()) + + "\n" + ) + screen_string += ( + "screen.physicalDotsPerInchY() -> " + + str(screen.physicalDotsPerInchY()) + + "\n" + ) + screen_string += ( + "screen.logicalDotsPerInchX() -> " + + str(screen.logicalDotsPerInchX()) + + "\n" + ) + screen_string += ( + "screen.logicalDotsPerInchY() -> " + + str(screen.logicalDotsPerInchY()) + + "\n" + ) + screen_string += ( + "screen.devicePixelRatio() -> " + str(screen.devicePixelRatio()) + "\n" + ) + return screen_string + + class TestModulesAcrossResolutions(unittest.TestCase): """TestCase for modules across resolutions.""" @@ -62,5 +100,9 @@ class TestModulesAcrossResolutions(unittest.TestCase): soi.reorganize() self.assertEqual( - expected_result, [module["meta"] for module in soi.modules], + expected_result, + [module["meta"] for module in soi.modules], + "All modules added to SOI and calling reorganize should result in " + "expected 'meta' information. Screen is: \n" + + screen_information(), )