aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-05-08 08:54:40 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-05-09 08:18:09 +0000
commit9dc1aa57dfbf9c684e5c75451dd028b88099c348 (patch)
tree3238c74a2f8470a64e9a5f60ada359b69edbba3f /sources/pyside2
parent4a519e4c5b40f7128c422691cdb0073387e2c9e3 (diff)
Add more bindings for QtNetwork
Task-number: PYSIDE-487 Change-Id: Id9a06b83173b9a8880a256fb45e8d85fb1978d65 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/pyside2')
-rw-r--r--sources/pyside2/PySide2/QtNetwork/CMakeLists.txt18
-rw-r--r--sources/pyside2/PySide2/QtNetwork/typesystem_network.xml33
-rw-r--r--sources/pyside2/tests/QtNetwork/CMakeLists.txt1
-rw-r--r--sources/pyside2/tests/QtNetwork/dnslookup_test.py59
-rw-r--r--sources/pyside2/tests/registry/exists_darwin_5_9_4_ci.py6
-rw-r--r--sources/pyside2/tests/registry/exists_linux_5_9_4_ci.py6
-rw-r--r--sources/pyside2/tests/registry/exists_win32_5_9_4_ci.py6
7 files changed, 120 insertions, 9 deletions
diff --git a/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt b/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt
index 68037017..0267bfae 100644
--- a/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt
@@ -4,18 +4,35 @@ set(QtNetwork_OPTIONAL_SRC )
set(QtNetwork_DROPPED_ENTRIES )
check_qt_class(QtNetwork QSslCertificate QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
+check_qt_class(QtNetwork QSslCertificateExtension QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
check_qt_class(QtNetwork QSslCipher QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
check_qt_class(QtNetwork QSslConfiguration QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
+check_qt_class(QtNetwork QSslDiffieHellmanParameters QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
+# Problems with operator==(QSslEllipticCurve,QSslEllipticCurve)
+# check_qt_class(QtNetwork QSslEllipticCurve QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
check_qt_class(QtNetwork QSslError QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
check_qt_class(QtNetwork QSslKey QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
+check_qt_class(QtNetwork QSslPreSharedKeyAuthenticator QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
check_qt_class(QtNetwork QSslSocket QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
+check_qt_class(QtNetwork QSctpServer QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
+check_qt_class(QtNetwork QSctpSocket QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
+
set(QtNetwork_SRC
${QtNetwork_GEN_DIR}/qabstractnetworkcache_wrapper.cpp
${QtNetwork_GEN_DIR}/qabstractsocket_wrapper.cpp
${QtNetwork_GEN_DIR}/qauthenticator_wrapper.cpp
+${QtNetwork_GEN_DIR}/qdnsdomainnamerecord_wrapper.cpp
+${QtNetwork_GEN_DIR}/qdnshostaddressrecord_wrapper.cpp
+${QtNetwork_GEN_DIR}/qdnslookup_wrapper.cpp
+${QtNetwork_GEN_DIR}/qdnsmailexchangerecord_wrapper.cpp
+${QtNetwork_GEN_DIR}/qdnsservicerecord_wrapper.cpp
+${QtNetwork_GEN_DIR}/qdnstextrecord_wrapper.cpp
${QtNetwork_GEN_DIR}/qhostaddress_wrapper.cpp
${QtNetwork_GEN_DIR}/qhostinfo_wrapper.cpp
+${QtNetwork_GEN_DIR}/qhstspolicy_wrapper.cpp
+${QtNetwork_GEN_DIR}/qhttpmultipart_wrapper.cpp
+${QtNetwork_GEN_DIR}/qhttppart_wrapper.cpp
${QtNetwork_GEN_DIR}/qipv6address_wrapper.cpp
${QtNetwork_GEN_DIR}/qlocalserver_wrapper.cpp
${QtNetwork_GEN_DIR}/qlocalsocket_wrapper.cpp
@@ -26,6 +43,7 @@ ${QtNetwork_GEN_DIR}/qnetworkconfiguration_wrapper.cpp
${QtNetwork_GEN_DIR}/qnetworkconfigurationmanager_wrapper.cpp
${QtNetwork_GEN_DIR}/qnetworkcookie_wrapper.cpp
${QtNetwork_GEN_DIR}/qnetworkcookiejar_wrapper.cpp
+${QtNetwork_GEN_DIR}/qnetworkdatagram_wrapper.cpp
${QtNetwork_GEN_DIR}/qnetworkdiskcache_wrapper.cpp
${QtNetwork_GEN_DIR}/qnetworkinterface_wrapper.cpp
${QtNetwork_GEN_DIR}/qnetworkproxy_wrapper.cpp
diff --git a/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml b/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml
index 1ec4bd43..a9040c31 100644
--- a/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml
+++ b/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml
@@ -71,6 +71,22 @@
<modify-function signature="waitForDisconnected(int)" allow-thread="yes" />
</object-type>
+ <value-type name="QDnsDomainNameRecord"/>
+ <value-type name="QDnsHostAddressRecord"/>
+ <object-type name="QDnsLookup">
+ <enum-type name="Error"/>
+ <enum-type name="Type"/>
+ </object-type>
+ <value-type name="QDnsMailExchangeRecord"/>
+ <value-type name="QDnsServiceRecord"/>
+ <value-type name="QDnsTextRecord"/>
+ <value-type name="QHstsPolicy" since="5.9">
+ <enum-type name="PolicyFlag" flags="PolicyFlags"/>
+ </value-type>
+ <object-type name="QHttpMultiPart">
+ <enum-type name="ContentType"/>
+ </object-type>
+ <value-type name="QHttpPart" since="5.9"/>
<object-type name="QTcpServer">
<modify-function signature="waitForNewConnection(int,bool*)" allow-thread="yes">
<!-- FIXME removing default expression means user will always have to pass a value, but he wouldn't have to -->
@@ -172,6 +188,7 @@
</modify-function>
</object-type>
<object-type name="QNetworkCookieJar"/>
+ <value-type name="QNetworkDatagram" since="5.8"/>
<object-type name="QNetworkReply">
<enum-type name="NetworkError"/>
</object-type>
@@ -282,17 +299,30 @@
<object-type name="QNetworkDiskCache"/>
<value-type name="QNetworkCacheMetaData"/>
+ <object-type name="QSctpServer"/>
+ <object-type name="QSctpSocket"/>
+
<!-- The following entries may be present in the system or not. Keep this section organized. -->
<value-type name="QSslCertificate">
<enum-type name="SubjectInfo"/>
</value-type>
+ <value-type name="QSslCertificateExtension"/>
+
<value-type name="QSslCipher"/>
<value-type name="QSslConfiguration">
<enum-type name="NextProtocolNegotiationStatus" />
</value-type>
+ <value-type name="QSslDiffieHellmanParameters" since="5.8">
+ <enum-type name="Error"/>
+ </value-type>
+
+ <!-- Problems with operator==(QSslEllipticCurve,QSslEllipticCurve)
+ <object-type name="QSslEllipticCurve"/>
+ -->
+
<value-type name="QSslError">
<enum-type name="SslError"/>
</value-type>
@@ -304,6 +334,9 @@
<modify-function signature="connectToHostEncrypted(const QString&amp;,quint16,QFlags&lt;QIODevice::OpenModeFlag>,QAbstractSocket::NetworkLayerProtocol)" allow-thread="yes" />
<modify-function signature="waitForEncrypted(int)" allow-thread="yes" />
</object-type>
+
+ <value-type name="QSslPreSharedKeyAuthenticator"/>
+
<!-- The above entries may be present in the system or not. Keep this section organized. -->
</typesystem>
diff --git a/sources/pyside2/tests/QtNetwork/CMakeLists.txt b/sources/pyside2/tests/QtNetwork/CMakeLists.txt
index f93de5c1..c14c19fa 100644
--- a/sources/pyside2/tests/QtNetwork/CMakeLists.txt
+++ b/sources/pyside2/tests/QtNetwork/CMakeLists.txt
@@ -1,6 +1,7 @@
PYSIDE_TEST(bug_446.py)
PYSIDE_TEST(bug_1084.py)
PYSIDE_TEST(accessManager_test.py)
+PYSIDE_TEST(dnslookup_test.py)
# Qt5: QHttp is gone PYSIDE_TEST(http_test.py)
PYSIDE_TEST(tcpserver_test.py)
PYSIDE_TEST(udpsocket_test.py)
diff --git a/sources/pyside2/tests/QtNetwork/dnslookup_test.py b/sources/pyside2/tests/QtNetwork/dnslookup_test.py
new file mode 100644
index 00000000..b0375b0f
--- /dev/null
+++ b/sources/pyside2/tests/QtNetwork/dnslookup_test.py
@@ -0,0 +1,59 @@
+#############################################################################
+##
+## 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$
+##
+#############################################################################
+
+'''Test cases for QDnsLookup'''
+
+import unittest
+
+from PySide2.QtCore import QCoreApplication
+from PySide2.QtNetwork import QDnsLookup
+
+class DnsLookupTestCase(unittest.TestCase):
+ '''Test case for QDnsLookup'''
+
+ def setUp(self):
+ self._app = QCoreApplication([])
+ self._lookup = QDnsLookup(QDnsLookup.ANY, 'www.qt.io')
+ self._lookup.finished.connect(self._finished)
+
+ def tearDown(self):
+ del self._lookup
+
+ def _finished(self):
+ if self._lookup.error() == QDnsLookup.NoError:
+ nameRecords = self._lookup.canonicalNameRecords()
+ if nameRecords:
+ print(nameRecords[0].name())
+ self._app.quit()
+
+ def testLookup(self):
+ self._lookup.lookup()
+ self._app.exec_()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/sources/pyside2/tests/registry/exists_darwin_5_9_4_ci.py b/sources/pyside2/tests/registry/exists_darwin_5_9_4_ci.py
index 787ae0e8..95f3fe23 100644
--- a/sources/pyside2/tests/registry/exists_darwin_5_9_4_ci.py
+++ b/sources/pyside2/tests/registry/exists_darwin_5_9_4_ci.py
@@ -12558,12 +12558,12 @@ if "PySide2.QtNetwork" in sys.modules:
"QNetworkAccessManager.head": ('PySide2.QtNetwork.QNetworkRequest',),
"QNetworkAccessManager.isStrictTransportSecurityEnabled": (),
"QNetworkAccessManager.networkAccessible": (),
- "QNetworkAccessManager.post": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QIODevice')],
+ "QNetworkAccessManager.post": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QIODevice'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtNetwork.QHttpMultiPart')],
"QNetworkAccessManager.proxy": (),
"QNetworkAccessManager.proxyFactory": (),
- "QNetworkAccessManager.put": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QIODevice')],
+ "QNetworkAccessManager.put": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QIODevice'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtNetwork.QHttpMultiPart')],
"QNetworkAccessManager.redirectPolicy": (),
- "QNetworkAccessManager.sendCustomRequest": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray', 'PySide2.QtCore.QIODevice')],
+ "QNetworkAccessManager.sendCustomRequest": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray', 'PySide2.QtCore.QIODevice'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray', 'PySide2.QtNetwork.QHttpMultiPart')],
"QNetworkAccessManager.setCache": ('PySide2.QtNetwork.QAbstractNetworkCache',),
"QNetworkAccessManager.setConfiguration": ('PySide2.QtNetwork.QNetworkConfiguration',),
"QNetworkAccessManager.setCookieJar": ('PySide2.QtNetwork.QNetworkCookieJar',),
diff --git a/sources/pyside2/tests/registry/exists_linux_5_9_4_ci.py b/sources/pyside2/tests/registry/exists_linux_5_9_4_ci.py
index 77ee0fdf..79e82625 100644
--- a/sources/pyside2/tests/registry/exists_linux_5_9_4_ci.py
+++ b/sources/pyside2/tests/registry/exists_linux_5_9_4_ci.py
@@ -12555,12 +12555,12 @@ if "PySide2.QtNetwork" in sys.modules:
"QNetworkAccessManager.head": ('PySide2.QtNetwork.QNetworkRequest',),
"QNetworkAccessManager.isStrictTransportSecurityEnabled": (),
"QNetworkAccessManager.networkAccessible": (),
- "QNetworkAccessManager.post": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QIODevice')],
+ "QNetworkAccessManager.post": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QIODevice'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtNetwork.QHttpMultiPart')],
"QNetworkAccessManager.proxy": (),
"QNetworkAccessManager.proxyFactory": (),
- "QNetworkAccessManager.put": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QIODevice')],
+ "QNetworkAccessManager.put": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QIODevice'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtNetwork.QHttpMultiPart')],
"QNetworkAccessManager.redirectPolicy": (),
- "QNetworkAccessManager.sendCustomRequest": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray', 'PySide2.QtCore.QIODevice')],
+ "QNetworkAccessManager.sendCustomRequest": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray', 'PySide2.QtCore.QIODevice'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray', 'PySide2.QtNetwork.QHttpMultiPart')],
"QNetworkAccessManager.setCache": ('PySide2.QtNetwork.QAbstractNetworkCache',),
"QNetworkAccessManager.setConfiguration": ('PySide2.QtNetwork.QNetworkConfiguration',),
"QNetworkAccessManager.setCookieJar": ('PySide2.QtNetwork.QNetworkCookieJar',),
diff --git a/sources/pyside2/tests/registry/exists_win32_5_9_4_ci.py b/sources/pyside2/tests/registry/exists_win32_5_9_4_ci.py
index 08f7ca89..20c30e1a 100644
--- a/sources/pyside2/tests/registry/exists_win32_5_9_4_ci.py
+++ b/sources/pyside2/tests/registry/exists_win32_5_9_4_ci.py
@@ -12570,12 +12570,12 @@ if "PySide2.QtNetwork" in sys.modules:
"QNetworkAccessManager.head": ('PySide2.QtNetwork.QNetworkRequest',),
"QNetworkAccessManager.isStrictTransportSecurityEnabled": (),
"QNetworkAccessManager.networkAccessible": (),
- "QNetworkAccessManager.post": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QIODevice')],
+ "QNetworkAccessManager.post": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QIODevice'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtNetwork.QHttpMultiPart')],
"QNetworkAccessManager.proxy": (),
"QNetworkAccessManager.proxyFactory": (),
- "QNetworkAccessManager.put": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QIODevice')],
+ "QNetworkAccessManager.put": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QIODevice'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtNetwork.QHttpMultiPart')],
"QNetworkAccessManager.redirectPolicy": (),
- "QNetworkAccessManager.sendCustomRequest": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray', 'PySide2.QtCore.QIODevice')],
+ "QNetworkAccessManager.sendCustomRequest": [('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray', 'PySide2.QtCore.QByteArray'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray', 'PySide2.QtCore.QIODevice'), ('PySide2.QtNetwork.QNetworkRequest', 'PySide2.QtCore.QByteArray', 'PySide2.QtNetwork.QHttpMultiPart')],
"QNetworkAccessManager.setCache": ('PySide2.QtNetwork.QAbstractNetworkCache',),
"QNetworkAccessManager.setConfiguration": ('PySide2.QtNetwork.QNetworkConfiguration',),
"QNetworkAccessManager.setCookieJar": ('PySide2.QtNetwork.QNetworkCookieJar',),