aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/tests
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-09-03 14:14:00 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-09-05 01:38:14 +0200
commit3dcef048966bf0783cec66bf7e63307a1182cadf (patch)
tree47955878593acd80935a4a15c1f58f9f3a2aa00f /sources/pyside2/tests
parent155a2608309f44757bfa6433a44129e306cd5cce (diff)
Add Qt Core bindings for Qt 5.14
Adding the new QCalendar class is required to unlock the branch since the rejected constructor QDate(int, int, int, QCalendar) causes test failures in of QDate. Task-number: PYSIDE-487 Change-Id: I2720b92f3356421065f539ea0eba75d3049b9702 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside2/tests')
-rw-r--r--sources/pyside2/tests/QtCore/CMakeLists.txt3
-rw-r--r--sources/pyside2/tests/QtCore/qcalendar_test.py47
2 files changed, 50 insertions, 0 deletions
diff --git a/sources/pyside2/tests/QtCore/CMakeLists.txt b/sources/pyside2/tests/QtCore/CMakeLists.txt
index d05699f16..35e42e2ae 100644
--- a/sources/pyside2/tests/QtCore/CMakeLists.txt
+++ b/sources/pyside2/tests/QtCore/CMakeLists.txt
@@ -52,6 +52,9 @@ PYSIDE_TEST(qbytearray_concatenation_operator_test.py)
PYSIDE_TEST(qbytearray_operator_iadd_test.py)
PYSIDE_TEST(qbytearray_operator_test.py)
PYSIDE_TEST(qbytearray_test.py)
+if (Qt5Core_VERSION VERSION_EQUAL 5.14.0 OR Qt5Core_VERSION VERSION_GREATER 5.14.0)
+ PYSIDE_TEST(qcalendar_test.py)
+endif()
PYSIDE_TEST(qcbor_test.py)
PYSIDE_TEST(qcollator_test.py)
PYSIDE_TEST(qcommandlineparser_test.py)
diff --git a/sources/pyside2/tests/QtCore/qcalendar_test.py b/sources/pyside2/tests/QtCore/qcalendar_test.py
new file mode 100644
index 000000000..4b595a011
--- /dev/null
+++ b/sources/pyside2/tests/QtCore/qcalendar_test.py
@@ -0,0 +1,47 @@
+#!/usr/bin/python
+
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the test suite of Qt for Python.
+##
+## $QT_BEGIN_LICENSE:GPL-EXCEPT$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see https://www.qt.io/terms-conditions. For further
+## information use the contact form at https://www.qt.io/contact-us.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 3 as published by the Free Software
+## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+'''Test cases for QCalendar (5.14)'''
+
+import unittest
+
+from PySide2.QtCore import QCalendar
+
+class TestQCalendar (unittest.TestCase):
+ def testCalendar(self):
+ calendar = QCalendar(QCalendar.System.Gregorian)
+ self.assertTrue(calendar.isGregorian())
+ self.assertEqual(calendar.name(), 'Gregorian')
+ self.assertFalse(calendar.hasYearZero())
+ self.assertEqual(calendar.monthsInYear(2019), 12)
+
+
+if __name__ == '__main__':
+ unittest.main()