diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-05 16:00:34 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-10 09:12:26 +0000 |
commit | bf214f7495c929e5e3f6fdd4745a9daa6ab9ee1a (patch) | |
tree | df4936090d0fd7c29d01e5b21004d790dc65c97e /sources/pyside2/tests/QtNetwork | |
parent | 4f03dbe5e35b3682ba86c820bcc22b762f970d8c (diff) |
Add bindings for 5.12
Task-number: PYSIDE-487
Change-Id: Ib37efc4e480a978f920d3bc40756fe7abd59cb19
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside2/tests/QtNetwork')
-rw-r--r-- | sources/pyside2/tests/QtNetwork/CMakeLists.txt | 1 | ||||
-rw-r--r-- | sources/pyside2/tests/QtNetwork/qpassworddigestor_test.py | 45 |
2 files changed, 46 insertions, 0 deletions
diff --git a/sources/pyside2/tests/QtNetwork/CMakeLists.txt b/sources/pyside2/tests/QtNetwork/CMakeLists.txt index c14c19fa9..57c5266c8 100644 --- a/sources/pyside2/tests/QtNetwork/CMakeLists.txt +++ b/sources/pyside2/tests/QtNetwork/CMakeLists.txt @@ -3,6 +3,7 @@ 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(qpassworddigestor_test.py) PYSIDE_TEST(tcpserver_test.py) PYSIDE_TEST(udpsocket_test.py) PYSIDE_TEST(qipv6address_test.py) diff --git a/sources/pyside2/tests/QtNetwork/qpassworddigestor_test.py b/sources/pyside2/tests/QtNetwork/qpassworddigestor_test.py new file mode 100644 index 000000000..503ffecdc --- /dev/null +++ b/sources/pyside2/tests/QtNetwork/qpassworddigestor_test.py @@ -0,0 +1,45 @@ +#!/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$ +## +############################################################################# + +'''Test cases for QPasswordDigestor''' + +import unittest + +from PySide2.QtCore import QByteArray, QCryptographicHash +from PySide2.QtNetwork import QPasswordDigestor + +class TestPasswordDigestor(unittest.TestCase): + def test(self): + b = QPasswordDigestor.deriveKeyPbkdf1(QCryptographicHash.Sha1, + b'test', b'saltnpep', 10, 20) + self.assertEqual(b.size(), 20) + +if __name__ == '__main__': + unittest.main() |