Skip to content

Commit

Permalink
Add test to check if QgsFeature.setAttributes handles 0 vs NULL corre…
Browse files Browse the repository at this point in the history
…ctly

Currently failing
  • Loading branch information
m-kuhn committed Jul 13, 2015
1 parent 156a0e9 commit 160d1bf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/src/python/test_qgsfeature.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
import qgis
import os

from qgis.core import QgsFeature, QgsGeometry, QgsPoint, QgsVectorLayer
from qgis.core import QgsFeature, QgsGeometry, QgsPoint, QgsVectorLayer, NULL
from utilities import (unitTestDataPath,
getQgisTestApp,
TestCase,
unittest
)
from unittest import expectedFailure

QGISAPP, CANVAS, IFACE, PARENT = getQgisTestApp()


Expand Down Expand Up @@ -68,6 +70,14 @@ def test_Attributes(self):

assert myAttributes == myExpectedAttributes, myMessage

@expectedFailure
def test_SetAttribute(self):
feat = QgsFeature()
feat.initAttributes(1)
feat.setAttributes([0])
feat.setAttributes([NULL])
assert [NULL] == feat.attributes()

def test_DeleteAttribute(self):
feat = QgsFeature()
feat.initAttributes(3)
Expand Down

0 comments on commit 160d1bf

Please sign in to comment.