Esempio n. 1
0
class TestQWidgetWithDpi:

    @classmethod
    def setup_class(cls):
        ''' Initializes a QtGui.QApplication '''
        cls.app = QApplication([])

    @classmethod
    def teardown_class(cls):
        ''' Destruct the QtGui.QApplication '''
        cls.app.deleteLater()

    def setup(self):
        ''' Construct a tested class '''
        self.tested_cls = QWidgetWithDpi()

    def test_setMinimumSize(self):
        self.tested_cls.setMinimumSize(300, 220)
        assert self.tested_cls.minimumSize() == QSize(round(300 * 1.5), round(220 * 1.25))

    def test_resize(self):
        self.tested_cls.resize(400, 400)
        assert self.tested_cls.size() == QSize(round(400 * 1.5), round(400 * 1.25))
Esempio n. 2
0
 def setup(self):
     ''' Construct a tested class '''
     self.tested_cls = QWidgetWithDpi()