aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtCore
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-03-22 18:08:17 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:05 -0300
commite360a53087975cac53975f00e747991b7eb818af (patch)
treeac1ca11d0d9e81623d98315b861b33e3365932ba /tests/QtCore
parentc1f507f87ad03651e899ad54199fe028b426515d (diff)
Fix bug 685 - "The second arg. of QObject.findChildren doesn't have a default value and doesn't support regexes."
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests/QtCore')
-rw-r--r--tests/QtCore/qobject_parent_test.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/QtCore/qobject_parent_test.py b/tests/QtCore/qobject_parent_test.py
index df8121666..cda6022e8 100644
--- a/tests/QtCore/qobject_parent_test.py
+++ b/tests/QtCore/qobject_parent_test.py
@@ -4,7 +4,7 @@
import unittest
from sys import getrefcount
-from PySide.QtCore import QObject, QTimer
+from PySide.QtCore import *
class ParentRefCountCase(unittest.TestCase):
'''Test case for the refcount changes of setParent'''
@@ -108,6 +108,15 @@ class ParentCase(unittest.TestCase):
self.assertEqual(sorted(target_children), sorted(test_children))
+ # test findChildren default value
+ res = parent.findChildren(QTimer)
+ self.assertEqual(len(res), 20)
+
+ # test findChildre with a regex
+ res = parent.findChildren(QObject, QRegExp("^fo+"))
+ self.assertEqual(sorted(res), sorted(test_children))
+
+
def testParentEquality(self):
#QObject.parent() == parent
parent = QObject()