aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-06-08 17:41:32 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-06-08 17:51:44 -0300
commitcf6e5f16687a0b28677a5c4ff035eebc5424272d (patch)
treed9719019498a3e863c9cfbe93f193b05939f2cc9 /tests
parent1a698a7e954fbf005f46aadda2300f475bfec292 (diff)
Created unit test for QDate, QTime, QDateTime, QUrl hash function.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>, Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/QtCore/CMakeLists.txt1
-rw-r--r--tests/QtCore/hash_test.py25
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index 536d4086..eef6ffe1 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -3,6 +3,7 @@ PYSIDE_TEST(buffer_test.py)
PYSIDE_TEST(child_event_test.py)
PYSIDE_TEST(deletelater_test.py)
PYSIDE_TEST(duck_punching_test.py)
+PYSIDE_TEST(hash_test.py)
PYSIDE_TEST(missing_symbols_test.py)
PYSIDE_TEST(qabs_test.py)
PYSIDE_TEST(qabstracttransition_test.py)
diff --git a/tests/QtCore/hash_test.py b/tests/QtCore/hash_test.py
new file mode 100644
index 00000000..4fdecca7
--- /dev/null
+++ b/tests/QtCore/hash_test.py
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+import unittest
+from PySide.QtCore import QDate, QDateTime, QTime, QUrl
+
+class HashTest(unittest.TestCase):
+ def testInsert(self):
+ myHash = {}
+ qdate = QDate.currentDate()
+ qdatetime = QDateTime.currentDateTime()
+ qtime = QTime.currentTime()
+ qurl = QUrl("http://www.pyside.org")
+
+ myHash[qdate] = "QDate"
+ myHash[qdatetime] = "QDateTime"
+ myHash[qtime] = "QTime"
+ myHash[qurl] = "QUrl"
+
+ self.assertEqual(myHash[qdate], "QDate")
+ self.assertEqual(myHash[qdatetime], "QDateTime")
+ self.assertEqual(myHash[qtime], "QTime")
+ self.assertEqual(myHash[qurl], "QUrl")
+
+
+if __name__ == '__main__':
+ unittest.main()