diff options
author | Hugo Parente Lima <hugo.lima@openbossa.org> | 2010-06-08 11:17:48 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.lima@openbossa.org> | 2010-06-10 15:31:43 -0300 |
commit | e47b49f86d63845fe214768838c4fc7c55e3012a (patch) | |
tree | cd2f2c85dcd7a7fe6a17408c34246900cd7606e0 /tests/signals/signal_connectiontype_support_test.py | |
parent | 00918cb847dfa1b28acb791c66cb444bc2123f79 (diff) |
Re-add the possibility to run tests by module.
Diffstat (limited to 'tests/signals/signal_connectiontype_support_test.py')
-rwxr-xr-x | tests/signals/signal_connectiontype_support_test.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/signals/signal_connectiontype_support_test.py b/tests/signals/signal_connectiontype_support_test.py new file mode 100755 index 000000000..d0c35c53a --- /dev/null +++ b/tests/signals/signal_connectiontype_support_test.py @@ -0,0 +1,28 @@ + +import unittest + +from PySide.QtCore import QObject, SIGNAL, Qt + +class Dummy(QObject): + """Dummy class used in this test.""" + def __init__(self, parent=None): + QObject.__init__(self, parent) + +class TestConnectionTypeSupport(unittest.TestCase): + def callback(self, *args): + if tuple(self.args) == args: + self.called = True + + def testNoArgs(self): + """Connect signal using a Qt.ConnectionType as argument""" + obj1 = Dummy() + + QObject.connect(obj1, SIGNAL('foo'), self.callback, Qt.DirectConnection) + self.args = tuple() + obj1.emit(SIGNAL('foo'), *self.args) + + self.assert_(self.called) + + +if __name__ == '__main__': + unittest.main() |