diff options
author | Renato Filho <renato.filho@openbossa.org> | 2011-05-03 16:09:40 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:54:18 -0300 |
commit | 1d3063a8231ea2e44a946ac8dcb76faff8cb8e9e (patch) | |
tree | dc30ab7427190c37f063a3437825e93c8cd90039 /tests | |
parent | c1f1b62957e498e39d5309670700e5cab9b3e0e1 (diff) |
Created unit test for bug #785.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/QtGui/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/QtGui/bug_785.py | 29 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt index db6b19c1c..d86fbf31b 100644 --- a/tests/QtGui/CMakeLists.txt +++ b/tests/QtGui/CMakeLists.txt @@ -52,6 +52,7 @@ PYSIDE_TEST(bug_740.py) PYSIDE_TEST(bug_743.py) PYSIDE_TEST(bug_750.py) PYSIDE_TEST(bug_778.py) +PYSIDE_TEST(bug_785.py) PYSIDE_TEST(bug_793.py) PYSIDE_TEST(bug_811.py) PYSIDE_TEST(bug_836.py) diff --git a/tests/QtGui/bug_785.py b/tests/QtGui/bug_785.py new file mode 100644 index 000000000..905119c50 --- /dev/null +++ b/tests/QtGui/bug_785.py @@ -0,0 +1,29 @@ +import sys
+
+import unittest
+from PySide.QtGui import QApplication, QStandardItemModel, QStandardItem, QItemSelection
+
+class Bug324(unittest.TestCase):
+ def testOperators(self):
+ model = QStandardItemModel()
+ for i in range(100):
+ model.appendRow(QStandardItem("Item: %d"%i))
+
+ first = model.index(0, 0)
+ second = model.index(10, 0)
+ third = model.index(20, 0)
+ fourth = model.index(30, 0)
+
+ sel = QItemSelection(first, second)
+ sel2 = QItemSelection()
+ sel2.select(third, fourth)
+
+ sel3 = sel + sel2 #check operator +
+ self.assertEqual(len(sel3), 2)
+ sel4 = sel
+ sel4 += sel2 #check operator +=
+ self.assertEqual(len(sel4), 2)
+ self.assertEqual(sel4, sel3)
+
+if __name__ == "__main__":
+ unittest.main()
|