aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtCore/qobject_parent_test.py
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-10-06 11:36:24 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:56:11 -0300
commitedaefbce481634b2f9d5a6e28c2e73db7f958602 (patch)
tree489c4169928d8e688cff79f80e564e93bad9a57f /tests/QtCore/qobject_parent_test.py
parent75843bf45a494c37168ff2ee5672490ca1dee9cf (diff)
Updated QtCore modue to works with python 2.x and 3.x
Diffstat (limited to 'tests/QtCore/qobject_parent_test.py')
-rw-r--r--tests/QtCore/qobject_parent_test.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/QtCore/qobject_parent_test.py b/tests/QtCore/qobject_parent_test.py
index cda6022e8..ea393d896 100644
--- a/tests/QtCore/qobject_parent_test.py
+++ b/tests/QtCore/qobject_parent_test.py
@@ -87,7 +87,7 @@ class ParentCase(unittest.TestCase):
child.setObjectName(name % i)
child = parent.findChild(QObject)
- self.assert_(isinstance(child, QObject))
+ self.assertTrue(isinstance(child, QObject))
def testFindChildren(self):
#QObject.findChildren() with all QObject
@@ -105,8 +105,7 @@ class ParentCase(unittest.TestCase):
# Emulates findChildren with the intended outcome
target_children = [x for x in children if x.objectName() == target_name]
test_children = parent.findChildren(QObject, target_name)
-
- self.assertEqual(sorted(target_children), sorted(test_children))
+ self.assertEqual(target_children, test_children)
# test findChildren default value
res = parent.findChildren(QTimer)
@@ -114,7 +113,7 @@ class ParentCase(unittest.TestCase):
# test findChildre with a regex
res = parent.findChildren(QObject, QRegExp("^fo+"))
- self.assertEqual(sorted(res), sorted(test_children))
+ self.assertEqual(res, test_children)
def testParentEquality(self):
@@ -218,7 +217,7 @@ class ReparentingTest(unittest.TestCase):
object_list.append(obj)
obj.setParent(parent)
for child in parent.children():
- self.assert_(child in object_list)
+ self.assertTrue(child in object_list)
def testParentedExtQObjectType(self):
object_list = []
@@ -241,7 +240,7 @@ class ReparentingTest(unittest.TestCase):
for obj in object_list:
obj.setParent(new_parent)
for child in new_parent.children():
- self.assert_(child in object_list)
+ self.assertTrue(child in object_list)
def testReparentedExtQObjectType(self):
object_list = []