aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/tests/QtWidgets
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside2/tests/QtWidgets')
-rw-r--r--sources/pyside2/tests/QtWidgets/CMakeLists.txt2
-rw-r--r--sources/pyside2/tests/QtWidgets/add_action_test.py3
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_363.py59
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_632.py54
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_711.py3
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_860.py2
-rw-r--r--sources/pyside2/tests/QtWidgets/qaction_test.py3
-rw-r--r--sources/pyside2/tests/QtWidgets/qshortcut_test.py22
-rw-r--r--sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qtoolbar_test.py3
10 files changed, 23 insertions, 132 deletions
diff --git a/sources/pyside2/tests/QtWidgets/CMakeLists.txt b/sources/pyside2/tests/QtWidgets/CMakeLists.txt
index 6682136ea..f6c3c01b8 100644
--- a/sources/pyside2/tests/QtWidgets/CMakeLists.txt
+++ b/sources/pyside2/tests/QtWidgets/CMakeLists.txt
@@ -9,7 +9,6 @@ PYSIDE_TEST(bug_243.py)
PYSIDE_TEST(bug_307.py)
PYSIDE_TEST(bug_324.py)
PYSIDE_TEST(bug_338.py)
-PYSIDE_TEST(bug_363.py)
PYSIDE_TEST(bug_389.py)
PYSIDE_TEST(bug_400.py)
PYSIDE_TEST(bug_416.py)
@@ -28,7 +27,6 @@ PYSIDE_TEST(bug_575.py)
PYSIDE_TEST(bug_576.py)
PYSIDE_TEST(bug_585.py)
PYSIDE_TEST(bug_589.py)
-PYSIDE_TEST(bug_632.py)
PYSIDE_TEST(bug_635.py)
PYSIDE_TEST(bug_640.py)
PYSIDE_TEST(bug_653.py)
diff --git a/sources/pyside2/tests/QtWidgets/add_action_test.py b/sources/pyside2/tests/QtWidgets/add_action_test.py
index c8a7c2269..d4af8b5d1 100644
--- a/sources/pyside2/tests/QtWidgets/add_action_test.py
+++ b/sources/pyside2/tests/QtWidgets/add_action_test.py
@@ -37,7 +37,8 @@ from init_paths import init_test_paths
init_test_paths(False)
from PySide2.QtCore import SLOT
-from PySide2.QtWidgets import QMenuBar, QAction, QPushButton
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import QMenuBar, QPushButton
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/bug_363.py b/sources/pyside2/tests/QtWidgets/bug_363.py
deleted file mode 100644
index 910525fed..000000000
--- a/sources/pyside2/tests/QtWidgets/bug_363.py
+++ /dev/null
@@ -1,59 +0,0 @@
-#############################################################################
-##
-## 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$
-##
-#############################################################################
-
-''' Test bug 363: http://bugs.openbossa.org/show_bug.cgi?id=363'''
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from helper.usesqapplication import UsesQApplication
-from PySide2 import QtCore, QtWidgets
-
-# Check for desktop object lifetime
-class BugTest(UsesQApplication):
- def mySlot(self):
- pass
-
- # test if it is possible to connect with a desktop object after storing that on an auxiliar variable
- def testCase1(self):
- desktop = QtWidgets.QApplication.desktop()
- desktop.resized[int].connect(self.mySlot)
- self.assertTrue(True)
-
- # test if it is possible to connect with a desktop object without storing that on an auxiliar variable
- def testCase2(self):
- QtWidgets.QApplication.desktop().resized[int].connect(self.mySlot)
- self.assertTrue(True)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/sources/pyside2/tests/QtWidgets/bug_632.py b/sources/pyside2/tests/QtWidgets/bug_632.py
deleted file mode 100644
index d836b2ff6..000000000
--- a/sources/pyside2/tests/QtWidgets/bug_632.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#############################################################################
-##
-## 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$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtWidgets import QLineEdit, QApplication
-
-
-class Bug589(unittest.TestCase):
- def testWrongSignature(self):
- text = QLineEdit("PySide bug 632")
- a = b = c = d = 0
- self.assertRaises(TypeError, text.getTextMargins, (a, b, c, d))
-
- def testTupleReturn(self):
- text = QLineEdit("PySide bug 632")
- text.setTextMargins(10, 20, 30, 40)
- (a, b, c, d) = text.getTextMargins()
- self.assertTrue((a, b, c, d), (10, 20, 30, 40))
-
-if __name__ == "__main__":
- app = QApplication(sys.argv)
- unittest.main()
diff --git a/sources/pyside2/tests/QtWidgets/bug_711.py b/sources/pyside2/tests/QtWidgets/bug_711.py
index 43e4b7bb2..3898e23f5 100644
--- a/sources/pyside2/tests/QtWidgets/bug_711.py
+++ b/sources/pyside2/tests/QtWidgets/bug_711.py
@@ -34,7 +34,8 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide2.QtWidgets import QToolBar, QApplication, QAction, QToolButton
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import QToolBar, QApplication, QToolButton
try:
xrange
diff --git a/sources/pyside2/tests/QtWidgets/bug_860.py b/sources/pyside2/tests/QtWidgets/bug_860.py
index 8cdab2e45..483973fdb 100644
--- a/sources/pyside2/tests/QtWidgets/bug_860.py
+++ b/sources/pyside2/tests/QtWidgets/bug_860.py
@@ -52,7 +52,7 @@ class MultipleSlotTest(UsesQApplication):
box.stateChanged.connect(checkboxMapper.map)
checkboxMapper.setMapping(box, box.text())
- checkboxMapper.mapped[str].connect(self.cb_changed)
+ checkboxMapper.mappedString[str].connect(self.cb_changed)
self._changed = False
box.setChecked(True)
self.assertTrue(self._changed)
diff --git a/sources/pyside2/tests/QtWidgets/qaction_test.py b/sources/pyside2/tests/QtWidgets/qaction_test.py
index 8fc8f6c05..d587a59b1 100644
--- a/sources/pyside2/tests/QtWidgets/qaction_test.py
+++ b/sources/pyside2/tests/QtWidgets/qaction_test.py
@@ -34,7 +34,8 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide2.QtWidgets import QAction, QWidget
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import QWidget
from helper.usesqapplication import UsesQApplication
class QPainterDrawText(UsesQApplication):
diff --git a/sources/pyside2/tests/QtWidgets/qshortcut_test.py b/sources/pyside2/tests/QtWidgets/qshortcut_test.py
index 18aec285d..dbe99167c 100644
--- a/sources/pyside2/tests/QtWidgets/qshortcut_test.py
+++ b/sources/pyside2/tests/QtWidgets/qshortcut_test.py
@@ -38,11 +38,13 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide2 import QtCore, QtGui, QtWidgets
+from PySide2.QtCore import Qt, QTimer
+from PySide2.QtGui import QKeySequence, QShortcut
+from PySide2.QtWidgets import QApplication, QWidget
-class Foo(QtWidgets.QWidget):
+class Foo(QWidget):
def __init__(self):
- QtWidgets.QWidget.__init__(self)
+ QWidget.__init__(self)
self.ok = False
self.copy = False
@@ -52,22 +54,22 @@ class Foo(QtWidgets.QWidget):
def slot_of_copy(self):
self.copy = True
-class MyShortcut(QtWidgets.QShortcut):
+class MyShortcut(QShortcut):
def __init__(self, keys, wdg, slot):
- QtWidgets.QShortcut.__init__(self, keys, wdg, slot)
+ QShortcut.__init__(self, keys, wdg, slot)
def emit_signal(self):
- self.emit(QtCore.SIGNAL("activated()"))
+ self.activated.emit()
class QAppPresence(unittest.TestCase):
def testQShortcut(self):
- self.qapp = QtWidgets.QApplication([])
+ self.qapp = QApplication([])
f = Foo()
- self.sc = MyShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Return), f, f.slot_of_foo)
- self.scstd = MyShortcut(QtGui.QKeySequence.Copy, f, f.slot_of_copy)
- QtCore.QTimer.singleShot(0, self.init);
+ self.sc = MyShortcut(QKeySequence(Qt.Key_Return), f, f.slot_of_foo)
+ self.scstd = MyShortcut(QKeySequence.Copy, f, f.slot_of_copy)
+ QTimer.singleShot(0, self.init);
self.qapp.exec_()
self.assertEqual(f.ok, True)
self.assertEqual(f.copy, True)
diff --git a/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py b/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py
index 0321b69a4..79842aac2 100644
--- a/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py
+++ b/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py
@@ -42,8 +42,8 @@ init_test_paths(False)
import py3kcompat as py3k
from helper.usesqapplication import UsesQApplication
-from PySide2.QtGui import QKeySequence
-from PySide2.QtWidgets import QAction
+from PySide2.QtGui import QAction, QKeySequence
+
class QStringQKeySequenceTest(UsesQApplication):
'''Tests conversions of QString to and from QKeySequence.'''
diff --git a/sources/pyside2/tests/QtWidgets/qtoolbar_test.py b/sources/pyside2/tests/QtWidgets/qtoolbar_test.py
index 856bf07f3..a70305c4a 100644
--- a/sources/pyside2/tests/QtWidgets/qtoolbar_test.py
+++ b/sources/pyside2/tests/QtWidgets/qtoolbar_test.py
@@ -36,7 +36,8 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide2.QtWidgets import QToolBar, QMainWindow, QAction
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import QToolBar, QMainWindow
from helper.usesqapplication import UsesQApplication