diff options
Diffstat (limited to 'sources/pyside2/tests')
| -rw-r--r-- | sources/pyside2/tests/QtCore/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | sources/pyside2/tests/QtCore/qcalendar_test.py | 47 |
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() |
