Created unit test for QDate, QTime, QDateTime, QUrl hash function.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>,
Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
1a698a7e95
commit
cf6e5f1668
2 changed files with 26 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ PYSIDE_TEST(buffer_test.py)
|
||||||
PYSIDE_TEST(child_event_test.py)
|
PYSIDE_TEST(child_event_test.py)
|
||||||
PYSIDE_TEST(deletelater_test.py)
|
PYSIDE_TEST(deletelater_test.py)
|
||||||
PYSIDE_TEST(duck_punching_test.py)
|
PYSIDE_TEST(duck_punching_test.py)
|
||||||
|
PYSIDE_TEST(hash_test.py)
|
||||||
PYSIDE_TEST(missing_symbols_test.py)
|
PYSIDE_TEST(missing_symbols_test.py)
|
||||||
PYSIDE_TEST(qabs_test.py)
|
PYSIDE_TEST(qabs_test.py)
|
||||||
PYSIDE_TEST(qabstracttransition_test.py)
|
PYSIDE_TEST(qabstracttransition_test.py)
|
||||||
|
|
|
||||||
25
tests/QtCore/hash_test.py
Normal file
25
tests/QtCore/hash_test.py
Normal file
|
|
@ -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()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue