aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-03-15 16:54:55 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:03 -0300
commita8be4c2326f01aa6ad209e3f9787553088e16b11 (patch)
treeb7454cc916003aa0caa1dbc6ba92ff837bb65b84 /tests
parent945f9bffd9e1b2dd797110c0a1738a3f273bc21f (diff)
Add unit test for bug 706 - "dataChanged signal raise an incorrect TypeError"
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/QtCore/CMakeLists.txt1
-rw-r--r--tests/QtCore/bug_706.py27
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index c6f9ffd43..434c8fe83 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -6,6 +6,7 @@ PYSIDE_TEST(bug_462.py)
PYSIDE_TEST(bug_505.py)
PYSIDE_TEST(bug_515.py)
PYSIDE_TEST(bug_656.py)
+PYSIDE_TEST(bug_706.py)
PYSIDE_TEST(blocking_signals_test.py)
PYSIDE_TEST(child_event_test.py)
PYSIDE_TEST(deepcopy_test.py)
diff --git a/tests/QtCore/bug_706.py b/tests/QtCore/bug_706.py
new file mode 100644
index 000000000..18250290d
--- /dev/null
+++ b/tests/QtCore/bug_706.py
@@ -0,0 +1,27 @@
+import unittest
+
+from PySide.QtCore import *
+
+class MyModel (QAbstractListModel):
+ def rowCount(self, parent = None):
+ return 3
+
+class TestBug706(unittest.TestCase):
+
+ def mySlot(self, idx, start, end):
+ self.start = start
+ self.end = end
+
+ def testIt(self):
+ self.start = None
+ self.end = None
+
+ app = QCoreApplication([])
+ model = MyModel()
+ model.columnsAboutToBeInserted.connect(self.mySlot)
+ model.columnsAboutToBeInserted.emit(QModelIndex(), 0, 1)
+ self.assertEqual(self.start, 0)
+ self.assertEqual(self.end, 1)
+
+if __name__ == '__main__':
+ unittest.main()