forked from gacarrillor/AppendFeaturesToLayer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make a basic (but real) test for plugin loading
- Loading branch information
1 parent
8c4b9a1
commit f78e8fb
Showing
3 changed files
with
14 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ __pycache__/ | |
*.py[cod] | ||
*$py.class | ||
|
||
.idea* | ||
|
||
# C extensions | ||
*.so | ||
|
||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |