Skip to content

Commit

Permalink
Add test for TextEditWidget NaN/NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Dec 6, 2019
1 parent d00520a commit 93ecb00
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/src/python/test_qgseditwidgets.py
Expand Up @@ -57,11 +57,14 @@ def doAttributeTest(self, idx, expected):
editwidget.setValue(NULL)
self.assertEqual(editwidget.value(), expected[3])

editwidget.setValue(float('nan'))
self.assertEqual(editwidget.value(), expected[4])

def test_SetValue(self):
self.createLayerWithOnePoint()

self.doAttributeTest(0, ['value', '123', NULL, NULL])
self.doAttributeTest(1, [NULL, 123, NULL, NULL])
self.doAttributeTest(0, ['value', '123', NULL, NULL, NULL])
self.doAttributeTest(1, [NULL, 123, NULL, NULL, NULL])

def testStringWithMaxLen(self):
""" tests that text edit wrappers correctly handle string fields with a maximum length """
Expand Down

0 comments on commit 93ecb00

Please sign in to comment.