aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/QtCore/CMakeLists.txt1
-rw-r--r--tests/QtCore/staticMetaObject_test.py18
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index cb83662d0..a088a327f 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -90,6 +90,7 @@ PYSIDE_TEST(qtnamespace_test.py)
PYSIDE_TEST(qurl_test.py)
PYSIDE_TEST(repr_test.py)
PYSIDE_TEST(setprop_on_ctor_test.py)
+PYSIDE_TEST(staticMetaObject_test.py)
PYSIDE_TEST(static_method_test.py)
PYSIDE_TEST(static_protected_methods_test.py)
PYSIDE_TEST(thread_signals_test.py)
diff --git a/tests/QtCore/staticMetaObject_test.py b/tests/QtCore/staticMetaObject_test.py
new file mode 100644
index 000000000..36ef10478
--- /dev/null
+++ b/tests/QtCore/staticMetaObject_test.py
@@ -0,0 +1,18 @@
+import unittest
+
+from PySide.QtCore import QObject, Slot, QMetaObject
+
+class MyObject(QObject):
+ @Slot(int, str)
+ def slot1(self, a, b):
+ pass
+
+class testAttribute(unittest.TestCase):
+ def testBug896(self):
+ mo = MyObject.staticMetaObject
+ self.assertTrue(isinstance(mo, QMetaObject))
+ self.assertEqual(mo.className(), 'MyObject')
+ self.assertTrue(mo.indexOfSlot('slot1(int,QString)') > -1)
+
+if __name__ == '__main__':
+ unittest.main()