summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-01-06 13:32:35 -0300
committerRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-01-06 14:17:21 -0300
commit932d9bced913443c4b339dccd204eeceed6385d6 (patch)
tree6753190aba227e191b36ee6853975ed95e81059b
parentfb9c1a97fec24a43c0f25bc1492b10a884420f4d (diff)
downloadpyside-932d9bced913443c4b339dccd204eeceed6385d6.tar.gz
pyside-932d9bced913443c4b339dccd204eeceed6385d6.tar.xz
pyside-932d9bced913443c4b339dccd204eeceed6385d6.zip
Created unit test for bug #585.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 8906a93..6032808 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 0000000..7c37150
--- /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()
+