Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Start on test suite for elevation profile item
- Loading branch information
1 parent
b8196b5
commit 74a5e88
Showing
2 changed files
with
71 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# -*- coding: utf-8 -*- | ||
"""QGIS Unit tests for QgsLayoutItemElevationProfile. | ||
.. 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) 2023 by Nyall Dawson' | ||
__date__ = '13/01/2023' | ||
__copyright__ = 'Copyright 2023, The QGIS Project' | ||
|
||
import os | ||
from time import sleep | ||
|
||
from qgis.PyQt.QtCore import QRectF, QDir | ||
from qgis.PyQt.QtGui import QColor | ||
from qgis.core import (QgsPrintLayout, | ||
QgsLayoutItemElevationProfile, | ||
QgsLayoutItemMap, | ||
QgsLayout, | ||
QgsMapSettings, | ||
QgsVectorLayer, | ||
QgsMarkerSymbol, | ||
QgsSingleSymbolRenderer, | ||
QgsRectangle, | ||
QgsProject, | ||
QgsLayoutObject, | ||
QgsProperty, | ||
QgsLayoutMeasurement, | ||
QgsLayoutItem, | ||
QgsLayoutPoint, | ||
QgsLayoutSize, | ||
QgsExpression, | ||
QgsMapLayerLegendUtils, | ||
QgsLegendStyle, | ||
QgsFontUtils, | ||
QgsLineSymbol, | ||
QgsMapThemeCollection, | ||
QgsCategorizedSymbolRenderer, | ||
QgsRendererCategory, | ||
QgsFillSymbol, | ||
QgsApplication) | ||
from qgis.testing import (start_app, | ||
unittest | ||
) | ||
from qgslayoutchecker import QgsLayoutChecker | ||
from test_qgslayoutitem import LayoutItemTestCase | ||
from utilities import unitTestDataPath | ||
|
||
start_app() | ||
TEST_DATA_DIR = unitTestDataPath() | ||
|
||
|
||
class TestQgsLayoutItemElevationProfile(unittest.TestCase, LayoutItemTestCase): | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
cls.item_class = QgsLayoutItemElevationProfile | ||
cls.report = "<h1>Python QgsLayoutItemElevationProfile Tests</h1>\n" | ||
|
||
@classmethod | ||
def tearDownClass(cls): | ||
report_file_path = "%s/qgistest.html" % QDir.tempPath() | ||
with open(report_file_path, 'a') as report_file: | ||
report_file.write(cls.report) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |