Skip to content

Commit

Permalink
Make a basic (but real) test for plugin loading
Browse files Browse the repository at this point in the history
  • Loading branch information
gacarrillor committed Sep 24, 2019
1 parent 8c4b9a1 commit f78e8fb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ __pycache__/
*.py[cod]
*$py.class

.idea*

# C extensions
*.so

Expand Down
Empty file modified run-docker-tests.sh
100644 → 100755
Empty file.
17 changes: 12 additions & 5 deletions tests/test_plugin_load.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
import qgis
import nose2

from qgis.core import QgsApplication
from qgis.testing import unittest, start_app
from qgis.testing.mocked import get_iface

start_app()

class TestPluginLoad(unittest.TestCase):

@classmethod
def setUpClass(self):
print('setUp test_plugin_load')
print('INFO: setUp test_plugin_load')
pass

def test_plugin_load(self):
print('Validating plugin load...')
self.assertEqual(1, 1)
print('INFO: Validating plugin load...')

from AppendFeaturesToLayer.append_features_to_layer_plugin import AppendFeaturesToLayerPlugin
plugin = AppendFeaturesToLayerPlugin(get_iface)
plugin.initGui()
self.assertIsNotNone(plugin.provider)

self.assertIn("ETL_LOAD", [provider.name() for provider in QgsApplication.processingRegistry().providers()])

def tearDownClass():
print('tearDown test_plugin_load')
print('INFO: tearDown test_plugin_load')

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

0 comments on commit f78e8fb

Please sign in to comment.