Skip to content
Snippets Groups Projects
Commit 91be9d1d authored by Thomas Holene Løkkeborg's avatar Thomas Holene Løkkeborg
Browse files

#125 la til debug output om skjerm i oppløsningstest

parent 85224386
No related branches found
No related tags found
1 merge request!70#125 løsning til oppløsningstrøbbel ved å bruke px ikke pt i font
Pipeline #82919 failed
...@@ -13,6 +13,7 @@ from PySide2.QtWidgets import QApplication ...@@ -13,6 +13,7 @@ from PySide2.QtWidgets import QApplication
from PySide2 import QtGui from PySide2 import QtGui
from PySide2.QtCore import QTimer, Qt from PySide2.QtCore import QTimer, Qt
from PySide2.QtTest import QTest from PySide2.QtTest import QTest
from PySide2.QtGui import QGuiApplication
from soitool.soi import SOI from soitool.soi import SOI
from soitool.modules.module_authentication_board import ( from soitool.modules.module_authentication_board import (
AuthenticationBoardModule, AuthenticationBoardModule,
...@@ -26,6 +27,43 @@ else: ...@@ -26,6 +27,43 @@ else:
app = QtGui.qApp 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): class TestModulesAcrossResolutions(unittest.TestCase):
"""TestCase for modules across resolutions.""" """TestCase for modules across resolutions."""
...@@ -62,5 +100,9 @@ class TestModulesAcrossResolutions(unittest.TestCase): ...@@ -62,5 +100,9 @@ class TestModulesAcrossResolutions(unittest.TestCase):
soi.reorganize() soi.reorganize()
self.assertEqual( 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(),
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment