diff options
Diffstat (limited to 'sources/pyside2/tests')
| -rw-r--r-- | sources/pyside2/tests/QtSvg/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | sources/pyside2/tests/QtSvg/qsvgrenderer_test.py | 10 | ||||
| -rw-r--r-- | sources/pyside2/tests/QtSvgWidgets/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | sources/pyside2/tests/QtSvgWidgets/qsvgwidget_test.py (renamed from sources/pyside2/tests/QtSvg/qsvgwidget_test.py) | 12 |
4 files changed, 13 insertions, 11 deletions
diff --git a/sources/pyside2/tests/QtSvg/CMakeLists.txt b/sources/pyside2/tests/QtSvg/CMakeLists.txt index 4f5e2805f..53d15e857 100644 --- a/sources/pyside2/tests/QtSvg/CMakeLists.txt +++ b/sources/pyside2/tests/QtSvg/CMakeLists.txt @@ -1,3 +1,2 @@ PYSIDE_TEST(qsvggenerator_test.py) PYSIDE_TEST(qsvgrenderer_test.py) -PYSIDE_TEST(qsvgwidget_test.py) diff --git a/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py b/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py index 88537edfe..3dd5b61f6 100644 --- a/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py +++ b/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py @@ -2,7 +2,7 @@ ############################################################################# ## -## Copyright (C) 2016 The Qt Company Ltd. +## Copyright (C) 2020 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the test suite of Qt for Python. @@ -36,15 +36,15 @@ 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.QtCore import * -from PySide2.QtWidgets import * -from PySide2.QtSvg import * +from PySide2.QtCore import QFile +from PySide2.QtGui import QGuiApplication +from PySide2.QtSvg import QSvgRenderer class QSvgRendererTest(unittest.TestCase): def testLoad(self): tigerPath = os.path.join(os.path.dirname(__file__), 'tiger.svg') - app = QApplication([]) + app = QGuiApplication([]) fromFile = QSvgRenderer(tigerPath) self.assertTrue(fromFile.isValid()) diff --git a/sources/pyside2/tests/QtSvgWidgets/CMakeLists.txt b/sources/pyside2/tests/QtSvgWidgets/CMakeLists.txt new file mode 100644 index 000000000..61952169a --- /dev/null +++ b/sources/pyside2/tests/QtSvgWidgets/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(qsvgwidget_test.py) diff --git a/sources/pyside2/tests/QtSvg/qsvgwidget_test.py b/sources/pyside2/tests/QtSvgWidgets/qsvgwidget_test.py index 17bf6527b..a3749c0ee 100644 --- a/sources/pyside2/tests/QtSvg/qsvgwidget_test.py +++ b/sources/pyside2/tests/QtSvgWidgets/qsvgwidget_test.py @@ -2,7 +2,7 @@ ############################################################################# ## -## Copyright (C) 2016 The Qt Company Ltd. +## Copyright (C) 2020 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the test suite of Qt for Python. @@ -36,14 +36,16 @@ 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.QtCore import * -from PySide2.QtWidgets import * -from PySide2.QtSvg import * +from PySide2.QtCore import QFile, QFileInfo, QDir +from PySide2.QtWidgets import QApplication +from PySide2.QtSvgWidgets import QSvgWidget class QSvgWidgetTest(unittest.TestCase): def testLoad(self): - tigerPath = os.path.join(os.path.dirname(__file__), 'tiger.svg') + dir = os.path.dirname(__file__) + tigerPath = QDir.cleanPath("{}/../QtSvg/tiger.svg".format(dir)) + self.assertTrue(QFileInfo.exists(tigerPath)) app = QApplication([]) fromFile = QSvgWidget() |
