diff options
author | Renato Filho <renato.filho@openbossa.org> | 2011-07-06 19:59:21 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:54:31 -0300 |
commit | fa59041a976fc4e57651b63f273d63f30f4fd161 (patch) | |
tree | 68d5cf98d190b83586f1c2fa8e9121b6484df032 /tests | |
parent | f2cecb5697bbc725432315a1e9c54b2904c3b1e2 (diff) |
Created unit test for bug #896.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
Hugo Parente <hugo.lima@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/QtCore/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/QtCore/staticMetaObject_test.py | 18 |
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() |