Created unit test for bug #860.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
Hugo Parente <hugo.lima@openbossa.org>
This commit is contained in:
parent
21dc823972
commit
00b1216fb9
2 changed files with 37 additions and 0 deletions
|
|
@ -61,6 +61,7 @@ PYSIDE_TEST(bug_834.py)
|
||||||
PYSIDE_TEST(bug_836.py)
|
PYSIDE_TEST(bug_836.py)
|
||||||
PYSIDE_TEST(bug_844.py)
|
PYSIDE_TEST(bug_844.py)
|
||||||
PYSIDE_TEST(bug_854.py)
|
PYSIDE_TEST(bug_854.py)
|
||||||
|
PYSIDE_TEST(bug_860.py)
|
||||||
PYSIDE_TEST(bug_862.py)
|
PYSIDE_TEST(bug_862.py)
|
||||||
PYSIDE_TEST(customproxywidget_test.py)
|
PYSIDE_TEST(customproxywidget_test.py)
|
||||||
PYSIDE_TEST(deepcopy_test.py)
|
PYSIDE_TEST(deepcopy_test.py)
|
||||||
|
|
|
||||||
36
tests/QtGui/bug_860.py
Normal file
36
tests/QtGui/bug_860.py
Normal file
|
|
@ -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()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue