Skip to content
Permalink
Browse files

Qt 5.7 dropped pyqtWrapperType (#6393)

version would need double check though
  • Loading branch information
3nids committed Feb 20, 2018
1 parent 713bfd3 commit b7194414b6d776d654386b033a32246aaa570957
Showing with 57 additions and 73 deletions.
  1. +57 −73 tests/src/python/test_qgssymbollayer.py
@@ -27,7 +27,9 @@

import os

from qgis.PyQt.QtCore import pyqtWrapperType, Qt, QDir, QFile, QIODevice, QPointF, QSize
from distutils.version import StrictVersion
from qgis.PyQt.Qt import PYQT_VERSION_STR
from qgis.PyQt.QtCore import Qt, QObject, QDir, QFile, QIODevice, QPointF, QSize
from qgis.PyQt.QtXml import QDomDocument
from qgis.PyQt.QtGui import QColor, QImage, QPainter

@@ -81,6 +83,12 @@

TEST_DATA_DIR = unitTestDataPath()

if StrictVersion(PYQT_VERSION_STR) < StrictVersion('5.7'):
from qgis.PyQt.QtCore import pyqtWrapperType
EXPECTED_TYPE = pyqtWrapperType
else:
EXPECTED_TYPE = type(QObject)


class TestQgsSymbolLayer(unittest.TestCase):

@@ -107,193 +115,169 @@ def tearDown(self):
def testBinding(self):
"""Test python bindings existence."""
mType = type(QgsSymbolLayer)
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsFillSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsGradientFillSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsLinePatternFillSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsPointPatternFillSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsImageFillSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsPointPatternFillSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsGradientFillSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsShapeburstFillSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsSVGFillSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsCentroidFillSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsRasterFillSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsSimpleFillSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsLineSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsMarkerLineSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsArrowSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsSimpleLineSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsMarkerSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsEllipseSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsFontMarkerSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsSimpleMarkerSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsFilledMarkerSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsSvgMarkerSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

try:
mType = type(QgsVectorFieldSymbolLayer)
except:
mType = None
mExpectedType = pyqtWrapperType
mMessage = 'Expected "%s" got "%s"' % (mExpectedType, mType)
assert mExpectedType == mType, mMessage
mMessage = 'Expected "%s" got "%s"' % (EXPECTED_TYPE, mType)
assert EXPECTED_TYPE == mType, mMessage

def testGettersSetters(self):
""" test base class getters/setters """

0 comments on commit b719441

Please sign in to comment.
You can’t perform that action at this time.