blob: d0c35c53a1d23fc20bea1b0d8f3d06f34c07d3dd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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()
|