From 290d773b323e8a0c7e9178b4c7997dcb2db5ba97 Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Tue, 23 Mar 2010 08:29:18 -0300 Subject: Adds a hash function to QTreeWidgetItem objects. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A "hashable" unit test was added as well. Reviewed by Anderson Lizardo Reviewed by Bruno Araújo --- tests/qtgui/hashabletype_test.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/qtgui/hashabletype_test.py (limited to 'tests') 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() + -- cgit v1.2.3