Skip to content

Commit

Permalink
Merge pull request #4466 from arnaud-morvan/test_python_qgsfields_get…
Browse files Browse the repository at this point in the history
…item

Add test for python QgsFields [] operator
  • Loading branch information
nyalldawson authored Aug 6, 2017
2 parents 54007ef + 4e436c2 commit 80d53e4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/src/python/test_qgsfield.py
Original file line number Diff line number Diff line change
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 80d53e4

Please sign in to comment.