GispoCoding / cookiecutter-qgis-plugin

A QGIS Plugin template to be set up with Cookiecutter
MIT License
22 stars 5 forks source link

Examples of how to test processing algorithm #58

Open angusmcb opened 1 month ago

angusmcb commented 1 month ago

Expected behaviour It would be nice if there was an example of how to test a processing algorithm in the tests folder. I'm struggling with how to do it - it seems as though the provider created in the template is not loaded in the testing environment.

Current behaviour Currently I have tried this but it's failing. It seems that the provider isn't loaded.

def test_processing_providers(qgis_app, qgis_processing):
    assert "my-plugin-provider" in [provider.id() for provider in qgis_app.processingRegistry().providers()]