summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-06-03 15:34:09 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-06-03 17:35:18 -0300
commit00b1216fb9022a64a2c32c58eb968925ee29be44 (patch)
tree4e6855c96d9f7c93f6f1270755d8d6eb746f9807
parent21dc8239726968738636d77d7e7f29164dc14ddb (diff)
downloadpyside-00b1216fb9022a64a2c32c58eb968925ee29be44.tar.gz
pyside-00b1216fb9022a64a2c32c58eb968925ee29be44.tar.xz
pyside-00b1216fb9022a64a2c32c58eb968925ee29be44.zip
Created unit test for bug #860.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Hugo Parente <hugo.lima@openbossa.org>
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_860.py36
2 files changed, 37 insertions, 0 deletions
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index dbd1adf..5aaef04 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -61,6 +61,7 @@ PYSIDE_TEST(bug_834.py)
PYSIDE_TEST(bug_836.py)
PYSIDE_TEST(bug_844.py)
PYSIDE_TEST(bug_854.py)
+PYSIDE_TEST(bug_860.py)
PYSIDE_TEST(bug_862.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(deepcopy_test.py)
diff --git a/tests/QtGui/bug_860.py b/tests/QtGui/bug_860.py
new file mode 100644
index 0000000..f161e96
--- /dev/null
+++ b/tests/QtGui/bug_860.py
@@ -0,0 +1,36 @@
+
+import sys
+import unittest
+
+from PySide.QtCore import QSignalMapper
+from PySide.QtGui import QCheckBox
+
+from helper import UsesQApplication
+
+class MultipleSlotTest(UsesQApplication):
+ def cb_changed(self, i):
+ self._changed = True
+
+ def cb_changedVoid(self):
+ self._changed = True
+
+ def testSignalMapper(self):
+ checkboxMapper = QSignalMapper()
+ box = QCheckBox('check me')
+ box.stateChanged.connect(checkboxMapper.map)
+
+ checkboxMapper.setMapping(box, box.text())
+ checkboxMapper.mapped[str].connect(self.cb_changed)
+ self._changed = False
+ box.setChecked(True)
+ self.assert_(self._changed)
+
+ def testSimpleSignal(self):
+ box = QCheckBox('check me')
+ box.stateChanged[int].connect(self.cb_changedVoid)
+ self._changed = False
+ box.setChecked(True)
+ self.assert_(self._changed)
+
+if __name__ == '__main__':
+ unittest.main()