Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b6af81
commit 958d5dd
Showing
5 changed files
with
104 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# -*- coding: utf-8 -*- | ||
"""QGIS Unit tests for QgsMapBoxGlStyleConverter. | ||
.. note:: This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
""" | ||
__author__ = '(C) 2020 by Nyall Dawson' | ||
__date__ = '29/07/2020' | ||
__copyright__ = 'Copyright 2020, The QGIS Project' | ||
|
||
import qgis # NOQA | ||
|
||
from qgis.PyQt.QtCore import (QSize, | ||
QDir) | ||
from qgis.PyQt.QtGui import (QImage, | ||
QPainter, | ||
QColor) | ||
from qgis.core import (QgsMapBoxGlStyleConverter, | ||
QgsCoordinateTransform, | ||
QgsProject, | ||
QgsPoint, | ||
QgsCoordinateReferenceSystem, | ||
QgsFillSymbol, | ||
QgsRenderChecker, | ||
QgsReadWriteContext, | ||
QgsRenderContext, | ||
QgsAnnotationPolygonItem, | ||
QgsRectangle, | ||
QgsLineString, | ||
QgsPolygon, | ||
QgsCurvePolygon, | ||
QgsCircularString | ||
) | ||
from qgis.PyQt.QtXml import QDomDocument | ||
|
||
from qgis.testing import start_app, unittest | ||
from utilities import unitTestDataPath | ||
|
||
start_app() | ||
TEST_DATA_DIR = unitTestDataPath() | ||
|
||
|
||
class TestQgsMapBoxGlStyleConverter(unittest.TestCase): | ||
|
||
def testNoLayer(self): | ||
c = QgsMapBoxGlStyleConverter({'x': 'y'}) | ||
self.assertEqual(c.errorMessage(), 'Could not find layers list in JSON') | ||
self.assertIsNone(c.renderer()) | ||
self.assertIsNone(c.labeling()) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |