Skip to content
Permalink
Browse files

Add tests for item provider registry new methods

  • Loading branch information
elpaso committed Mar 11, 2020
1 parent 016f7ed commit a3f49111a266fe12a70dcc1aa2c7dd2c784d1f67
Showing with 8 additions and 0 deletions.
  1. +8 −0 tests/src/python/test_qgsdataitemproviderregistry.py
@@ -72,6 +72,14 @@ def testRegistry(self):
self.assertNotIn('p2', [p.name() for p in registry.providers()])
self.assertEqual(registry.providers(), initial_providers)

def testProviderKey(self):
"""Tests finding provider by name and return dataProviderKey"""

registry = QgsDataItemProviderRegistry()
self.assertIsNotNone(registry.provider('PostGIS'))
self.assertIsNone(registry.provider('paper_and_pencil'))
self.assertEqual(registry.provider('PostGIS').dataProviderKey(), 'postgres')


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

0 comments on commit a3f4911

Please sign in to comment.
You can’t perform that action at this time.