diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-03-23 08:29:18 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-03-23 09:45:49 -0300 |
commit | 290d773b323e8a0c7e9178b4c7997dcb2db5ba97 (patch) | |
tree | c65589841192ed715a39436519ba8dde804a19e0 /tests | |
parent | c424162a0380609eed447fd370467813242fec08 (diff) |
Adds a hash function to QTreeWidgetItem objects.
A "hashable" unit test was added as well.
Reviewed by Anderson Lizardo <anderson.lizardo@openbossa.org>
Reviewed by Bruno Araújo <bruno.araujo@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/qtgui/hashabletype_test.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/qtgui/hashabletype_test.py b/tests/qtgui/hashabletype_test.py new file mode 100644 index 000000000..64683a398 --- /dev/null +++ b/tests/qtgui/hashabletype_test.py @@ -0,0 +1,18 @@ +'''Test cases for __hash__''' + +import unittest + +from PySide.QtGui import QTreeWidgetItem +from helper import UsesQApplication + +class HashableTest(UsesQApplication): + + def testQTreeWidgetItemHash(self): + h = {} + obj = QTreeWidgetItem() + h[obj] = 2 + self.assert_(h.get(obj), 2) + +if __name__ == '__main__': + unittest.main() + |