当前位置: 首页>>代码示例>>Python>>正文


Python testing.start_app函数代码示例

本文整理汇总了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
开发者ID:HeatherHillers,项目名称:QGIS,代码行数:27,代码来源:mocked.py

示例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()
开发者ID:fritsvanveen,项目名称:QGIS,代码行数:7,代码来源:test_qgscolorscheme.py

示例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()
开发者ID:AlisterH,项目名称:Quantum-GIS,代码行数:7,代码来源:test_qgsshortcutsmanager.py

示例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)
开发者ID:CS-SI,项目名称:QGIS,代码行数:26,代码来源:test_qgsowsconnection.py

示例5: setUpClass

    def setUpClass(cls):
        start_app()
        from processing.core.Processing import Processing
        Processing.initialize()
        cls.cleanup_paths = []

        assert Grass7Utils.installedVersion()
开发者ID:AlisterH,项目名称:Quantum-GIS,代码行数:7,代码来源:Grass7AlgorithmsRasterTest.py

示例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 = {}
开发者ID:GeoCat,项目名称:QGIS,代码行数:7,代码来源:QgisAlgorithmsTest.py

示例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()
开发者ID:jonnyforestGIS,项目名称:QGIS,代码行数:8,代码来源:test_qgsnewgeopackagelayerdialog.py

示例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 = {}
开发者ID:alexbruy,项目名称:QGIS,代码行数:8,代码来源:ProcessingGeneralTest.py

示例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)
开发者ID:alexbruy,项目名称:QGIS,代码行数:8,代码来源:SagaAlgorithmsTest.py

示例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()
开发者ID:pblottiere,项目名称:QGIS,代码行数:8,代码来源:test_qgsfieldformatters.py

示例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('\\', '/')
开发者ID:3liz,项目名称:Quantum-GIS,代码行数:9,代码来源:test_provider_wfs_gui.py

示例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)
开发者ID:FERRATON,项目名称:QGIS,代码行数:10,代码来源:QgisAlgorithmsTest.py

示例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
开发者ID:cz172638,项目名称:QGIS,代码行数:10,代码来源:test_qgsfontutils.py

示例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()
开发者ID:SrNetoChan,项目名称:Quantum-GIS,代码行数:11,代码来源:test_db_manager_postgis.py

示例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()
开发者ID:ufolr,项目名称:QGIS,代码行数:11,代码来源:test_provider_ogr_gpkg.py


注:本文中的qgis.testing.start_app函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。