Created new unittest model.
Separete unittest for module.
Only run unittest for compiled modules.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>,
Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
471486732b
commit
ab918abc1e
211 changed files with 241 additions and 79 deletions
33
tests/QtCore/thread_signals.py
Normal file
33
tests/QtCore/thread_signals.py
Normal file
|
|
@ -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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue