Skip to content

Commit

Permalink
Add test for python QgsFields [] operator
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-morvan committed May 3, 2017
1 parent 113ab01 commit 4e436c2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/src/python/test_qgsfield.py
Expand Up @@ -37,6 +37,14 @@ def test_exceptions(self):
fields.remove(111)

fields = ml.fields()

# check no error
self.assertEqual("value", fields[1].name())
self.assertEqual("value", fields[-1].name())
# check exceptions raised
with self.assertRaises(IndexError):
fields[111]

# check no error
fields.at(1)
# check exceptions raised
Expand Down

0 comments on commit 4e436c2

Please sign in to comment.