Skip to content

Commit

Permalink
improve(tests): check QGIS versions
Browse files Browse the repository at this point in the history
Inspired by @ptitjano
  • Loading branch information
Guts committed May 13, 2024
1 parent 1af462d commit 4bcc026
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/unit/test_plg_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def test_metadata_types(self):
# misc
self.assertLessEqual(len(__about__.__title_clean__), len(__about__.__title__))

# QGIS versions
# QGIS versions
self.assertIsInstance(
__about__.__plugin_md__.get("general").get("qgisminimumversion"), str
Expand All @@ -66,10 +67,13 @@ def test_metadata_types(self):
__about__.__plugin_md__.get("general").get("qgismaximumversion"), str
)

self.assertLessEqual(
float(__about__.__plugin_md__.get("general").get("qgisminimumversion")),
float(__about__.__plugin_md__.get("general").get("qgismaximumversion")),
min_version_parsed = parse(
__about__.__plugin_md__.get("general").get("qgisminimumversion")
)
max_version_parsed = parse(
__about__.__plugin_md__.get("general").get("qgismaximumversion")
)
self.assertLessEqual(min_version_parsed, max_version_parsed)

def test_required_metadata(self):
"""Test that the plugin __init__ will validate on plugins.qgis.org."""
Expand Down

0 comments on commit 4bcc026

Please sign in to comment.