Skip to content

Commit 4e436c2

Browse files
committed
Add test for python QgsFields [] operator
1 parent 113ab01 commit 4e436c2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/src/python/test_qgsfield.py

+8
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ def test_exceptions(self):
3737
fields.remove(111)
3838

3939
fields = ml.fields()
40+
41+
# check no error
42+
self.assertEqual("value", fields[1].name())
43+
self.assertEqual("value", fields[-1].name())
44+
# check exceptions raised
45+
with self.assertRaises(IndexError):
46+
fields[111]
47+
4048
# check no error
4149
fields.at(1)
4250
# check exceptions raised

0 commit comments

Comments
 (0)