示例#1
0
class TestQPushButtonWithDpi:
    ''' The test class that helps do the unit test for QPushButtonWithDpi '''

    @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 = QPushButtonWithDpi()

    def test_setFixedSize(self):
        self.tested_cls.setFixedSize(100, 100)
        assert self.tested_cls.size() == QSize(round(100 * 1.5), round(100 * 1.25))