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/QtCore/thread_signals_test.py | |
parent | 00918cb847dfa1b28acb791c66cb444bc2123f79 (diff) |
Re-add the possibility to run tests by module.
Diffstat (limited to 'tests/QtCore/thread_signals_test.py')
-rw-r--r-- | tests/QtCore/thread_signals_test.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/QtCore/thread_signals_test.py b/tests/QtCore/thread_signals_test.py new file mode 100644 index 000000000..9eea82907 --- /dev/null +++ b/tests/QtCore/thread_signals_test.py @@ -0,0 +1,33 @@ + +''' Test case for QObject.signalsBlocked() and blockSignal()''' + +import unittest +import os +from tempfile import mkstemp + +from PySide.QtCore import QObject, SIGNAL, QFile, QThread, QTimer, Qt +from helper import UsesQCoreApplication + +class MyThread(QThread): + + def run(self): + self.emit(SIGNAL("test(const QString&)"), "INdT - PySide"); + +class TestThreadSignal(UsesQCoreApplication): + + __called__ = True + def _callback(self, msg): + self.assertEqual(msg, "INdT - PySide") + self.__called__ = True + self.app.quit() + + def testThread(self): + t = MyThread() + QObject.connect(t, SIGNAL("test(const QString&)"), self._callback); + t.start() + + self.app.exec_() + self.assert_(self.__called__); + +if __name__ == '__main__': + unittest.main() |