Skip to content

Commit

Permalink
Add test for invalid provider
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 30, 2021
1 parent 3999292 commit f5e0222
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/src/python/test_provider_gpx.py
Expand Up @@ -157,6 +157,14 @@ def testUniqueStringsMatching(self):
def testUniqueValues(self):
pass

def test_invalid_source(self):
"""
Test various methods with an invalid source
"""
vl = QgsVectorLayer('not a gpx?type=waypoint', 'test', 'gpx')
self.assertFalse(vl.isValid())
self.assertEqual(vl.featureCount(), -1)


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

0 comments on commit f5e0222

Please sign in to comment.