diff options
author | Luciano Wolf <luciano.wolf@openbossa.org> | 2010-05-17 19:48:16 -0300 |
---|---|---|
committer | Renato Filho <renato.filho@openbossa.org> | 2010-05-17 19:55:33 -0300 |
commit | 9a8bc9c3d14f37e8a25ef820d1cdc25807842ee4 (patch) | |
tree | 0ae157c42a570627f7b6a6b9b52ea1b93b30d638 /tests/signals/ref01_test.py | |
parent | 16809db86b7fbdde8cb4cf3d525d9d8e34fc03be (diff) |
Adding new-style signal/slot tests.
Based on Marcelo Lira's source code.
Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>,
Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests/signals/ref01_test.py')
-rwxr-xr-x | tests/signals/ref01_test.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/signals/ref01_test.py b/tests/signals/ref01_test.py new file mode 100755 index 000000000..ba6839ec3 --- /dev/null +++ b/tests/signals/ref01_test.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import unittest +from PySide.QtCore import QObject, Signal + +class BoundAndUnboundSignalsTest(unittest.TestCase): + + def setUp(self): + self.methods = set(('connect', 'disconnect', 'emit')) + + def tearDown(self): + del self.methods + + def testUnboundSignal(self): + self.assertEqual(type(QObject.destroyed), Signal) + self.assertFalse(self.methods.issubset(dir(QObject.destroyed))) + + def testBoundSignal(self): + obj = QObject() + self.assertNotEqual(type(obj.destroyed), Signal) + self.assert_(self.methods.issubset(dir(obj.destroyed))) + +if __name__ == '__main__': + unittest.main() + + |