本文整理汇总了Python中qgis.testing.start_app函数的典型用法代码示例。如果您正苦于以下问题:Python start_app函数的具体用法?Python start_app怎么用?Python start_app使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了start_app函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_iface
def get_iface():
"""
Will return a mock QgisInterface object with some methods implemented in a generic way.
You can further control its behavior
by using the mock infrastructure. Refer to https://docs.python.org/3/library/unittest.mock.html
for more details.
Returns
-------
QgisInterface
A mock QgisInterface
"""
start_app()
my_iface = mock.Mock(spec=QgisInterface)
my_iface.mainWindow.return_value = QMainWindow()
canvas = QgsMapCanvas(my_iface.mainWindow())
canvas.resize(QSize(400, 400))
my_iface.mapCanvas.return_value = canvas
return my_iface
示例2: setUpClass
def setUpClass(cls):
"""Run before all tests"""
QCoreApplication.setOrganizationName("QGIS_Test")
QCoreApplication.setOrganizationDomain("QGIS_TestPyQgsColorScheme.com")
QCoreApplication.setApplicationName("QGIS_TestPyQgsColorScheme")
QSettings().clear()
start_app()
示例3: setUpClass
def setUpClass(cls):
"""Run before all tests"""
QCoreApplication.setOrganizationName("QGIS_Test")
QCoreApplication.setOrganizationDomain("QGIS_TestPyQgsWFSProviderGUI.com")
QCoreApplication.setApplicationName("QGIS_TestPyQgsWFSProviderGUI")
QgsSettings().clear()
start_app()
示例4: setUpClass
def setUpClass(cls):
"""Run before all tests"""
QCoreApplication.setOrganizationName("QGIS_Test")
QCoreApplication.setOrganizationDomain("QGIS_TestPyQgsColorScheme.com")
QCoreApplication.setApplicationName("QGIS_TestPyQgsColorScheme")
QgsSettings().clear()
start_app()
# setup some fake connections
settings = QgsSettings()
key = 'qgis/connections-wms/test/'
settings.setValue(key + 'url', 'aaa.bbb.com')
settings.setValue(key + 'referer', 'my_ref')
settings.setValue(key + 'ignoreGetMapURI', True)
settings.setValue(key + 'ignoreGetFeatureInfoURI', True)
settings.setValue(key + 'smoothPixmapTransform', True)
settings.setValue(key + 'dpiMode', 4)
settings.setValue(key + 'ignoreAxisOrientation', True)
settings.setValue(key + 'invertAxisOrientation', True)
key = 'qgis/connections-wfs/test/'
settings.setValue(key + 'url', 'ccc.ddd.com')
settings.setValue(key + 'version', '1.1.0')
settings.setValue(key + 'maxnumfeatures', '47')
settings.setValue(key + 'ignoreAxisOrientation', True)
settings.setValue(key + 'invertAxisOrientation', True)
示例5: setUpClass
def setUpClass(cls):
start_app()
from processing.core.Processing import Processing
Processing.initialize()
cls.cleanup_paths = []
assert Grass7Utils.installedVersion()
示例6: setUpClass
def setUpClass(cls):
start_app()
from processing.core.Processing import Processing
Processing.initialize()
cls.cleanup_paths = []
cls.in_place_layers = {}
cls.vector_layer_params = {}
示例7: setUpClass
def setUpClass(cls):
"""Run before all tests"""
QCoreApplication.setOrganizationName("QGIS_Test")
QCoreApplication.setOrganizationDomain("QGIS_TestPyQgsNewGeoPackageLayerDialog.com")
QCoreApplication.setApplicationName("QGIS_TestPyQgsNewGeoPackageLayerDialog")
QgsSettings().clear()
start_app()
cls.basetestpath = tempfile.mkdtemp()
示例8: setUpClass
def setUpClass(cls):
start_app()
from processing.core.Processing import Processing
Processing.initialize()
QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms())
cls.cleanup_paths = []
cls.in_place_layers = {}
cls.vector_layer_params = {}
示例9: setUpClass
def setUpClass(cls):
start_app()
from processing.core.Processing import Processing
Processing.initialize()
cls.cleanup_paths = []
cls.temp_dir = tempfile.mkdtemp()
cls.cleanup_paths.append(cls.temp_dir)
示例10: setUpClass
def setUpClass(cls):
"""Run before all tests"""
QCoreApplication.setOrganizationName("QGIS_Test")
QCoreApplication.setOrganizationDomain("QGIS_TestPyQgsColorScheme.com")
QCoreApplication.setApplicationName("QGIS_TestPyQgsColorScheme")
QgsSettings().clear()
QLocale.setDefault(QLocale(QLocale.English))
start_app()
示例11: setUpClass
def setUpClass(cls):
"""Run before all tests"""
QCoreApplication.setOrganizationName("QGIS_Test")
QCoreApplication.setOrganizationDomain("QGIS_TestPyQgsWFSProviderGUI.com")
QCoreApplication.setApplicationName("QGIS_TestPyQgsWFSProviderGUI")
QSettings().clear()
start_app()
cls.basetestpath = tempfile.mkdtemp().replace('\\', '/')
示例12: setUpClass
def setUpClass(cls):
start_app()
from processing.core.Processing import Processing
Processing.initialize()
ProcessingConfig.setSettingValue(ModelerUtils.MODELS_FOLDER, os.path.join(os.path.dirname(__file__), 'models'))
QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms())
cls.cleanup_paths = []
cls.in_place_layers = {}
cls.vector_layer_params = {}
cls._original_models_folder = ProcessingConfig.getSetting(ModelerUtils.MODELS_FOLDER)
示例13: setUpClass
def setUpClass(cls):
QCoreApplication.setOrganizationName("QGIS_Test")
QCoreApplication.setOrganizationDomain("QGIS_TestPyQgsFontUtils.com")
QCoreApplication.setApplicationName("QGIS_TestPyQgsFontUtils")
QgsSettings().clear()
start_app()
cls._family = getTestFontFamily()
cls._has_style = QgsFontUtils.fontFamilyHasStyle
示例14: setUpClass
def setUpClass(cls):
"""Run before all tests"""
# start ans setup server
cls.setUpServer()
# start a standalone qgis application
QCoreApplication.setOrganizationName("QGIS_Test")
QCoreApplication.setOrganizationDomain("TestPyQgsDBManagerPostgis.com")
QCoreApplication.setApplicationName("TestPyQgsDBManagerPostgis")
QgsSettings().clear()
start_app()
示例15: setUpClass
def setUpClass(cls):
"""Run before all tests"""
QCoreApplication.setOrganizationName("QGIS_Test")
QCoreApplication.setOrganizationDomain("TestPyQgsOGRProviderGpkg.com")
QCoreApplication.setApplicationName("TestPyQgsOGRProviderGpkg")
QgsSettings().clear()
start_app()
# Create test layer
cls.basetestpath = tempfile.mkdtemp()