summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-06-20 15:23:04 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-06-20 17:21:12 -0300
commit7220804be6899b59ae267c8432fbaf05a90f5d96 (patch)
tree3ce957ee955626c75557942d34d770cc92fc5f9c
parent7f611d1c53511e730abca92f34376a7cca7789a7 (diff)
downloadpyside-7220804be6899b59ae267c8432fbaf05a90f5d96.tar.gz
pyside-7220804be6899b59ae267c8432fbaf05a90f5d96.tar.xz
pyside-7220804be6899b59ae267c8432fbaf05a90f5d96.zip
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 ab95ac3..cb83662 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 0000000..da85621
--- /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()