summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-06-20 15:23:04 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:29 -0300
commitdb796e14d0184bdebc1efaf2bc6c85d1c592d494 (patch)
tree45fee2e51ed65b14cd885f5c14de1c41bfa4355f
parentebaf95ca1aba9febe62cb98cd40fc9e710c45b12 (diff)
Created test for QObject.inherits.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
-rw-r--r--tests/QtCore/CMakeLists.txt1
-rw-r--r--tests/QtCore/inherits_test.py16
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index ab95ac3c..cb83662d 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -24,6 +24,7 @@ PYSIDE_TEST(deletelater_test.py)
PYSIDE_TEST(destroysignal_test.py)
PYSIDE_TEST(duck_punching_test.py)
PYSIDE_TEST(hash_test.py)
+PYSIDE_TEST(inherits_test.py)
PYSIDE_TEST(max_signals.py)
PYSIDE_TEST(missing_symbols_test.py)
PYSIDE_TEST(mockclass_test.py)
diff --git a/tests/QtCore/inherits_test.py b/tests/QtCore/inherits_test.py
new file mode 100644
index 00000000..da85621e
--- /dev/null
+++ b/tests/QtCore/inherits_test.py
@@ -0,0 +1,16 @@
+import unittest
+
+from PySide.QtCore import QObject
+
+class MyObject(QObject):
+ pass
+
+class MainTest(unittest.TestCase):
+ def testInherits(self):
+ o = MyObject()
+ mo = o.metaObject()
+ self.assertEqual(mo.className(), 'MyObject')
+ self.assertTrue(o.inherits('MyObject'))
+
+if __name__ == '__main__':
+ unittest.main()