Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a test to make sure this never regresses again
  • Loading branch information
nirvn authored and github-actions[bot] committed Nov 23, 2021
1 parent a06c2ea commit 9bc3432
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/src/python/CMakeLists.txt
Expand Up @@ -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()
Expand Down
48 changes: 48 additions & 0 deletions tests/src/python/test_qgsproviderguiregistry.py
@@ -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.