本文整理汇总了Python中safe_qgis.utilities_test.getQgisTestApp函数的典型用法代码示例。如果您正苦于以下问题:Python getQgisTestApp函数的具体用法?Python getQgisTestApp怎么用?Python getQgisTestApp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getQgisTestApp函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: import
__author__ = '[email protected]'
__date__ = '20/01/2011'
__copyright__ = ('Copyright 2012, Australia Indonesia Facility for '
'Disaster Reduction')
import os
import unittest
from qgis.core import (
QgsProviderRegistry,
QgsCoordinateReferenceSystem,
QgsRasterLayer)
from safe_qgis.utilities_test import getQgisTestApp
from safe_interface import EXPDATA
QGISAPP = getQgisTestApp()
class QGISTest(unittest.TestCase):
"""Test the QGIS Environment"""
def test_QGISEnvironment(self):
"""QGIS environment has the expected providers"""
r = QgsProviderRegistry.instance()
#for item in r.providerList():
# print str(item)
#print 'Provider count: %s' % len(r.providerList())
assert 'gdal' in r.providerList()
assert 'ogr' in r.providerList()
示例2: import
isLayerPolygonal,
getLayerAttributeNames,
impactLayerAttribution,
dpiToMeters,
_addMinMaxToStyle)
from safe_qgis.utilities_test import (unitTestDataPath,
loadLayer,
getQgisTestApp)
from safe_qgis.exceptions import StyleError
from safe.common.exceptions import BoundingBoxError
from safe_qgis.test_keywords_dialog import (makePolygonLayer,
makePadangLayer,
makePointLayer)
from safe_qgis.utilities import getDefaults
QGISAPP, CANVAS, IFACE, PARENT = getQgisTestApp()
class UtilitiesTest(unittest.TestCase):
"""Tests for reading and writing of raster and vector data
"""
def setUp(self):
os.environ['LANG'] = 'en'
def tearDown(self):
pass
def test_stacktrace_html(self):
"""Stack traces can be caught and rendered as html
"""