Update bug_931 unit test to check for isinstance.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
Lauro Neto <lauro.neto@openbossa.org>
This commit is contained in:
parent
017fbee08f
commit
ac1b61deb9
1 changed files with 6 additions and 0 deletions
|
|
@ -2,6 +2,8 @@ import unittest
|
||||||
|
|
||||||
from PySide.QtCore import QObject, Signal
|
from PySide.QtCore import QObject, Signal
|
||||||
o = QObject()
|
o = QObject()
|
||||||
|
class MyObject(QObject):
|
||||||
|
s = Signal(int)
|
||||||
|
|
||||||
class CheckSignalType(unittest.TestCase):
|
class CheckSignalType(unittest.TestCase):
|
||||||
def testSignal(self):
|
def testSignal(self):
|
||||||
|
|
@ -11,5 +13,9 @@ class CheckSignalType(unittest.TestCase):
|
||||||
self.assertEqual(type(o.destroyed).__name__, "SignalInstance")
|
self.assertEqual(type(o.destroyed).__name__, "SignalInstance")
|
||||||
self.assertNotEqual(type(o.destroyed), Signal)
|
self.assertNotEqual(type(o.destroyed), Signal)
|
||||||
|
|
||||||
|
self.assertTrue(isinstance(o.destroyed, Signal))
|
||||||
|
self.assertTrue(isinstance(MyObject.s, Signal))
|
||||||
|
self.assertFalse(isinstance(int, Signal))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue