diff options
Diffstat (limited to 'sources/pyside6/tests/QtNetwork')
-rw-r--r-- | sources/pyside6/tests/QtNetwork/CMakeLists.txt | 3 | ||||
-rw-r--r-- | sources/pyside6/tests/QtNetwork/QtNetwork.pyproject | 11 | ||||
-rw-r--r-- | sources/pyside6/tests/QtNetwork/accessManager_test.py | 33 | ||||
-rw-r--r-- | sources/pyside6/tests/QtNetwork/bug_1084.py | 29 | ||||
-rw-r--r-- | sources/pyside6/tests/QtNetwork/bug_446.py | 33 | ||||
-rw-r--r-- | sources/pyside6/tests/QtNetwork/dnslookup_test.py | 32 | ||||
-rw-r--r-- | sources/pyside6/tests/QtNetwork/qhostinfo_test.py | 35 | ||||
-rw-r--r-- | sources/pyside6/tests/QtNetwork/qipv6address_test.py | 29 | ||||
-rw-r--r-- | sources/pyside6/tests/QtNetwork/qpassworddigestor_test.py | 30 | ||||
-rw-r--r-- | sources/pyside6/tests/QtNetwork/tcpserver_test.py | 32 | ||||
-rw-r--r-- | sources/pyside6/tests/QtNetwork/udpsocket_test.py | 32 |
11 files changed, 48 insertions, 251 deletions
diff --git a/sources/pyside6/tests/QtNetwork/CMakeLists.txt b/sources/pyside6/tests/QtNetwork/CMakeLists.txt index dd1d7c85d..bff3580a8 100644 --- a/sources/pyside6/tests/QtNetwork/CMakeLists.txt +++ b/sources/pyside6/tests/QtNetwork/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2023 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + PYSIDE_TEST(bug_446.py) PYSIDE_TEST(bug_1084.py) PYSIDE_TEST(accessManager_test.py) diff --git a/sources/pyside6/tests/QtNetwork/QtNetwork.pyproject b/sources/pyside6/tests/QtNetwork/QtNetwork.pyproject new file mode 100644 index 000000000..0ba3f5947 --- /dev/null +++ b/sources/pyside6/tests/QtNetwork/QtNetwork.pyproject @@ -0,0 +1,11 @@ +{ + "files": ["accessManager_test.py", + "bug_1084.py", + "bug_446.py", + "dnslookup_test.py", + "qhostinfo_test.py", + "qipv6address_test.py", + "qpassworddigestor_test.py", + "tcpserver_test.py", + "udpsocket_test.py"] +} diff --git a/sources/pyside6/tests/QtNetwork/accessManager_test.py b/sources/pyside6/tests/QtNetwork/accessManager_test.py index bb4fe33b0..87711b278 100644 --- a/sources/pyside6/tests/QtNetwork/accessManager_test.py +++ b/sources/pyside6/tests/QtNetwork/accessManager_test.py @@ -1,30 +1,5 @@ -############################################################################# -## -## Copyright (C) 2016 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$ -## -############################################################################# +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 '''Test cases for QHttp''' @@ -39,11 +14,11 @@ init_test_paths(False) from PySide6.QtCore import QUrl from PySide6.QtNetwork import QNetworkAccessManager, QNetworkReply, QNetworkRequest -from helper.usesqcoreapplication import UsesQCoreApplication +from helper.usesqapplication import UsesQApplication from httpd import TestServer -class AccessManagerCase(UsesQCoreApplication): +class AccessManagerCase(UsesQApplication): def setUp(self): super(AccessManagerCase, self).setUp() diff --git a/sources/pyside6/tests/QtNetwork/bug_1084.py b/sources/pyside6/tests/QtNetwork/bug_1084.py index d254313a8..515220c80 100644 --- a/sources/pyside6/tests/QtNetwork/bug_1084.py +++ b/sources/pyside6/tests/QtNetwork/bug_1084.py @@ -1,30 +1,5 @@ -############################################################################# -## -## Copyright (C) 2016 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$ -## -############################################################################# +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 ''' unit test for BUG #1084 ''' diff --git a/sources/pyside6/tests/QtNetwork/bug_446.py b/sources/pyside6/tests/QtNetwork/bug_446.py index eb8ab7a4a..f28ddb369 100644 --- a/sources/pyside6/tests/QtNetwork/bug_446.py +++ b/sources/pyside6/tests/QtNetwork/bug_446.py @@ -1,30 +1,5 @@ -############################################################################# -## -## Copyright (C) 2016 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$ -## -############################################################################# +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import os import sys @@ -36,10 +11,10 @@ from init_paths import init_test_paths init_test_paths(False) from PySide6.QtNetwork import QHostAddress, QTcpServer, QTcpSocket -from helper.usesqcoreapplication import UsesQCoreApplication +from helper.usesqapplication import UsesQApplication -class HttpSignalsCase(UsesQCoreApplication): +class HttpSignalsCase(UsesQApplication): '''Test case for launching QHttp signals''' DATA = bytes("PySide rocks", "UTF-8") diff --git a/sources/pyside6/tests/QtNetwork/dnslookup_test.py b/sources/pyside6/tests/QtNetwork/dnslookup_test.py index 21a128c75..c50a6b5d4 100644 --- a/sources/pyside6/tests/QtNetwork/dnslookup_test.py +++ b/sources/pyside6/tests/QtNetwork/dnslookup_test.py @@ -1,33 +1,9 @@ -############################################################################# -## -## Copyright (C) 2018 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$ -## -############################################################################# +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 '''Test cases for QDnsLookup''' +import gc import os import sys import unittest @@ -51,6 +27,8 @@ class DnsLookupTestCase(unittest.TestCase): def tearDown(self): del self._lookup + # PYSIDE-535: Need to collect garbage in PyPy to trigger deletion + gc.collect() def _finished(self): if self._lookup.error() == QDnsLookup.NoError: diff --git a/sources/pyside6/tests/QtNetwork/qhostinfo_test.py b/sources/pyside6/tests/QtNetwork/qhostinfo_test.py index d32d8c9b0..8d8d2cae4 100644 --- a/sources/pyside6/tests/QtNetwork/qhostinfo_test.py +++ b/sources/pyside6/tests/QtNetwork/qhostinfo_test.py @@ -1,30 +1,5 @@ -############################################################################# -## -## Copyright (C) 2021 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$ -## -############################################################################# +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 '''Test case for QHostInfo.''' @@ -37,7 +12,7 @@ sys.path.append(os.fspath(Path(__file__).resolve().parents[1])) from init_paths import init_test_paths init_test_paths(False) -from helper.usesqcoreapplication import UsesQCoreApplication +from helper.usesqapplication import UsesQApplication from PySide6.QtCore import (QCoreApplication, QElapsedTimer, QObject, QThread, Slot, SLOT) from PySide6.QtNetwork import QHostInfo @@ -70,10 +45,10 @@ class Receiver(QObject): self._slot_called = True -class QHostInfoTest(UsesQCoreApplication): +class QHostInfoTest(UsesQApplication): '''Test case for QHostInfo.''' def setUp(self): - UsesQCoreApplication.setUp(self) + UsesQApplication.setUp(self) self._timer = QElapsedTimer() def testStringBasedLookup(self): diff --git a/sources/pyside6/tests/QtNetwork/qipv6address_test.py b/sources/pyside6/tests/QtNetwork/qipv6address_test.py index 206e7e387..67b103d3c 100644 --- a/sources/pyside6/tests/QtNetwork/qipv6address_test.py +++ b/sources/pyside6/tests/QtNetwork/qipv6address_test.py @@ -1,30 +1,5 @@ -############################################################################# -## -## Copyright (C) 2016 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$ -## -############################################################################# +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 '''Test cases for QIPv6Address''' diff --git a/sources/pyside6/tests/QtNetwork/qpassworddigestor_test.py b/sources/pyside6/tests/QtNetwork/qpassworddigestor_test.py index 9e8dbe768..db7a90da9 100644 --- a/sources/pyside6/tests/QtNetwork/qpassworddigestor_test.py +++ b/sources/pyside6/tests/QtNetwork/qpassworddigestor_test.py @@ -1,32 +1,6 @@ #!/usr/bin/python - -############################################################################# -## -## Copyright (C) 2018 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$ -## -############################################################################# +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 '''Test cases for QPasswordDigestor''' diff --git a/sources/pyside6/tests/QtNetwork/tcpserver_test.py b/sources/pyside6/tests/QtNetwork/tcpserver_test.py index 83eec5660..845afdfae 100644 --- a/sources/pyside6/tests/QtNetwork/tcpserver_test.py +++ b/sources/pyside6/tests/QtNetwork/tcpserver_test.py @@ -1,33 +1,9 @@ -############################################################################# -## -## Copyright (C) 2016 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$ -## -############################################################################# +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 '''Test cases for QTCPServer''' +import gc import os import sys import unittest @@ -50,6 +26,8 @@ class ListenDefaultArgsCase(unittest.TestCase): def tearDown(self): # Release resources del self.server + # PYSIDE-535: Need to collect garbage in PyPy to trigger deletion + gc.collect() def testDefaultArgs(self): # @bug 108 diff --git a/sources/pyside6/tests/QtNetwork/udpsocket_test.py b/sources/pyside6/tests/QtNetwork/udpsocket_test.py index 630577ab6..950849801 100644 --- a/sources/pyside6/tests/QtNetwork/udpsocket_test.py +++ b/sources/pyside6/tests/QtNetwork/udpsocket_test.py @@ -1,33 +1,9 @@ -############################################################################# -## -## Copyright (C) 2016 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$ -## -############################################################################# +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 '''Test cases for QUdpSocket''' +import gc import os import sys import unittest @@ -62,6 +38,8 @@ class HttpSignalsCase(unittest.TestCase): del self.socket del self.server del self.app + # PYSIDE-535: Need to collect garbage in PyPy to trigger deletion + gc.collect() def sendPackage(self): addr = QHostAddress(QHostAddress.LocalHost) |