summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-01-06 13:32:35 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:51:44 -0300
commitb6343a7674347d1ddae27f61965eb83dd5b2223b (patch)
tree23a9477f9d0a2475191af1385908a0798babd1d7
parent5985c015b2b7efe3dad01e37b869a765dd1b8588 (diff)
Created unit test for bug #585.ps-1.0.0-beta3
Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_585.py26
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 8906a931..60328088 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -27,6 +27,7 @@ PYSIDE_TEST(bug_547.py)
PYSIDE_TEST(bug_549.py)
PYSIDE_TEST(bug_569.py)
PYSIDE_TEST(bug_576.py)
+PYSIDE_TEST(bug_585.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(deepcopy_test.py)
PYSIDE_TEST(float_to_int_implicit_conversion_test.py)
diff --git a/tests/QtGui/bug_585.py b/tests/QtGui/bug_585.py
new file mode 100644
index 00000000..7c371503
--- /dev/null
+++ b/tests/QtGui/bug_585.py
@@ -0,0 +1,26 @@
+'''Test bug 585: http://bugs.openbossa.org/show_bug.cgi?id=585'''
+
+from PySide import QtCore ,QtGui
+import sys
+import unittest
+
+
+class Bug585(unittest.TestCase):
+ def testCase(self):
+ app = QtGui.QApplication([])
+ self._tree = QtGui.QTreeWidget()
+ self._tree.setColumnCount(2)
+ i1 = QtGui.QTreeWidgetItem(self._tree, ['1', ])
+ i2 = QtGui.QTreeWidgetItem(self._tree, ['2', ])
+ refCount = sys.getrefcount(i1)
+
+ # this function return None
+ # because the topLevelItem does not has a parent item
+ # but still have a TreeWidget as a parent
+ self._tree.topLevelItem(0).parent()
+
+ self.assertEqual(refCount, sys.getrefcount(i1))
+
+if __name__ == '__main__':
+ unittest.main()
+