summaryrefslogtreecommitdiffstats
path: root/tests/QtCore/qdatetime_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/QtCore/qdatetime_test.py')
-rw-r--r--tests/QtCore/qdatetime_test.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/QtCore/qdatetime_test.py b/tests/QtCore/qdatetime_test.py
new file mode 100644
index 0000000..b732477
--- /dev/null
+++ b/tests/QtCore/qdatetime_test.py
@@ -0,0 +1,18 @@
+import unittest
+import datetime
+
+from PySide.QtCore import QDateTime, QDate, QTime
+
+class TestQDate (unittest.TestCase):
+ def testDateConversion(self):
+ dateTime = QDateTime(QDate(2011, 05, 17), QTime(11, 01, 14, 15))
+ dateTimePy = QDateTime(datetime.date(2011, 05, 17), datetime.time(11, 01, 14, 15))
+ self.assertEqual(dateTime, dateTimePy)
+
+ def testDateTimeConversion(self):
+ dateTime = QDateTime(QDate(2011, 05, 17), QTime(11, 01, 14, 15))
+ dateTimePy = QDateTime(datetime.datetime(2011, 05, 17, 11, 01, 14, 15))
+ self.assertEqual(dateTime, dateTimePy)
+
+if __name__ == '__main__':
+ unittest.main()