Skip to content
Permalink
Browse files
Add a test to make sure this never regresses again
  • Loading branch information
nirvn authored and github-actions committed Nov 23, 2021
1 parent a06c2ea commit 9bc3432f79f35c42bd8521d2990ca1ff4e44ad1c
Showing with 52 additions and 0 deletions.
  1. +4 −0 tests/src/python/CMakeLists.txt
  2. +48 −0 tests/src/python/test_qgsproviderguiregistry.py
@@ -385,6 +385,10 @@ if (NOT WIN32)
endif()
endif()

if (WITH_GUI)
ADD_PYTHON_TEST(PyQgsProviderGuiRegistry test_qgsproviderguiregistry.py)
endif()

if (WITH_DESKTOP)
ADD_PYTHON_TEST(PyQgsAppStartup test_qgsappstartup.py)
endif()
@@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsProviderGuiRegistry.
.. 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__ = 'Mathieu Pellerin'
__date__ = '23/11/2021'
__copyright__ = 'Copyright 2021, The QGIS Project'

import qgis # NOQA

from qgis.gui import (
QgsGui,
QgsProviderGuiRegistry
)
from qgis.testing import start_app, unittest
from utilities import unitTestDataPath

# Convenience instances in case you may need them
# to find the srs.db
start_app()


class TestQgsProviderGuiRegistry(unittest.TestCase):

def testProviderList(self):
"""
Test provider list
"""

providers = QgsGui.providerGuiRegistry().providerList()
self.assertIn('ogr', providers)
self.assertIn('gdal', providers)
self.assertIn('wms', providers)
self.assertIn('wms', providers)
self.assertIn('wcs', providers)
self.assertIn('delimitedtext', providers)
self.assertIn('arcgisfeatureserver', providers)
self.assertIn('spatialite', providers)
self.assertIn('WFS', providers)
self.assertIn('virtual', providers)


if __name__ == '__main__':
unittest.main()

0 comments on commit 9bc3432

Please sign in to comment.