summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-07-21 17:52:28 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-07-22 11:51:44 -0300
commitd9ce3c55f68f7c7fbbd71be25ea39b11adc4024b (patch)
tree7c0e8cd93357d7088ddfcdf5dc74ed05489df118 /tests
parent6abeac0c1f5b22a087b618d7ba876c5c73aab792 (diff)
downloadpyside-d9ce3c55f68f7c7fbbd71be25ea39b11adc4024b.tar.gz
pyside-d9ce3c55f68f7c7fbbd71be25ea39b11adc4024b.tar.xz
pyside-d9ce3c55f68f7c7fbbd71be25ea39b11adc4024b.zip
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 bce711f..9d62bcd 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):