diff options
author | Lauro Neto <lauro.neto@openbossa.org> | 2009-12-22 20:22:53 -0300 |
---|---|---|
committer | Lauro Neto <lauro.neto@openbossa.org> | 2010-01-04 20:01:48 -0300 |
commit | 33c837a48d5183bf7a6b1b4061fbb7a15d33114a (patch) | |
tree | 10346aae3b54db9b0ea6a16f2bc883775e5bd332 /tests/signals/lambda_test.py | |
parent | 359c973b425db0c27675add1a330734bbd7d8dbd (diff) |
Split signal tests into gui and core tests
Can't use a QApplication and a QCoreApplication in
the same process
Diffstat (limited to 'tests/signals/lambda_test.py')
-rw-r--r-- | tests/signals/lambda_test.py | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/tests/signals/lambda_test.py b/tests/signals/lambda_test.py index b9793d880..dff743c84 100644 --- a/tests/signals/lambda_test.py +++ b/tests/signals/lambda_test.py @@ -7,15 +7,7 @@ import unittest from PySide.QtCore import QObject, SIGNAL, QProcess -try: - from PySide.QtGui import QApplication, QSpinBox, QPushButton -except ImportError: - QApplication = object - QSpinBox = object - QPushButton = object - -from helper import UsesQApplication, UsesQCoreApplication -from helper import decorators +from helper import UsesQCoreApplication class Dummy(QObject): @@ -69,25 +61,5 @@ class QtSigLambda(UsesQCoreApplication): self.assertEqual(dummy.called, proc.exitCode()) -@decorators.requires('PySide.QtGui') -class QtGuiSigLambda(UsesQApplication): - - def testButton(self): - #Connecting a lambda to a QPushButton.clicked() - obj = QPushButton('label') - QObject.connect(obj, SIGNAL('clicked()'), - lambda: setattr(obj, 'called', True)) - obj.click() - self.assert_(obj.called) - - def testSpinButton(self): - #Connecting a lambda to a QPushButton.clicked() - obj = QSpinBox() - arg = 444 - QObject.connect(obj, SIGNAL('valueChanged(int)'), - lambda x: setattr(obj, 'arg', 444)) - obj.setValue(444) - self.assertEqual(obj.arg, arg) - if __name__ == '__main__': unittest.main() |