aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-07-21 17:52:28 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:38 -0300
commit9dd8f98e736dc70ae4f1a78f13ee643a63aa2e47 (patch)
tree08c38f61b8bd9e135abc6f882dcc04cf5d2bee90 /tests
parenta0566f992848f36311f48295c2d8d006802c9b35 (diff)
Update unit test for static metaobjet to work with new optimizations
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Lauro Neto <lauro.neto@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/signals/static_metaobject_test.py24
1 files changed, 8 insertions, 16 deletions
diff --git a/tests/signals/static_metaobject_test.py b/tests/signals/static_metaobject_test.py
index bce711f85..9d62bcdc2 100644
--- a/tests/signals/static_metaobject_test.py
+++ b/tests/signals/static_metaobject_test.py
@@ -2,12 +2,10 @@
"""Tests covering signal emission and receiving to python slots"""
-import sys
import unittest
-import functools
-from PySide.QtCore import *
-from helper import BasicPySlotCase, UsesQCoreApplication
+from PySide.QtCore import QObject, SIGNAL
+from helper import UsesQCoreApplication
class MyObject(QObject):
def __init__(self, parent=None):
@@ -24,27 +22,21 @@ class StaticMetaObjectTest(UsesQCoreApplication):
o = MyObject()
o2 = MyObject()
- m = o.metaObject()
# SIGNAL foo not created yet
- self.assertEqual(m.indexOfSignal("foo()"), -1)
+ self.assertEqual(o.metaObject().indexOfSignal("foo()"), -1)
o.connect(SIGNAL("foo()"), o2.mySlot)
# SIGNAL foo create after connect
- self.assert_(m.indexOfSignal("foo()") > 0)
+ self.assert_(o.metaObject().indexOfSignal("foo()") > 0)
- m = o2.metaObject()
- # SIGNAL propagate to others objects of the same type
- self.assert_(m.indexOfSignal("foo()") > 0)
+ # SIGNAL does not propagate to others objects of the same type
+ self.assertEqual(o2.metaObject().indexOfSignal("foo()"), -1)
del o
- # SIGNAL foo continues registered after deletion of original object
- self.assert_(m.indexOfSignal("foo()") > 0)
-
del o2
o = MyObject()
- m = o.metaObject()
- # new objects still have the SIGNAL foo registered
- self.assert_(m.indexOfSignal("foo()") > 0)
+ # The SIGNAL was destroyed with old objects
+ self.assertEqual(o.metaObject().indexOfSignal("foo()"), -1)
def testSharedSignalEmission(self):