mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
Handle null values in processing attribute tests
This commit is contained in:
parent
94fa450efd
commit
6dbdbead0c
@ -31,7 +31,7 @@ import difflib
|
|||||||
import functools
|
import functools
|
||||||
|
|
||||||
from qgis.PyQt.QtCore import QVariant
|
from qgis.PyQt.QtCore import QVariant
|
||||||
from qgis.core import QgsApplication, QgsFeatureRequest
|
from qgis.core import QgsApplication, QgsFeatureRequest, NULL
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
# Get a backup, we will patch this one later
|
# Get a backup, we will patch this one later
|
||||||
@ -170,8 +170,10 @@ class TestCase(_TestCase):
|
|||||||
|
|
||||||
# Round field (only numeric so it works with __all__)
|
# Round field (only numeric so it works with __all__)
|
||||||
if 'precision' in cmp and field_expected.type() in [QVariant.Int, QVariant.Double, QVariant.LongLong]:
|
if 'precision' in cmp and field_expected.type() in [QVariant.Int, QVariant.Double, QVariant.LongLong]:
|
||||||
attr_expected = round(attr_expected, cmp['precision'])
|
if not attr_expected == NULL:
|
||||||
attr_result = round(attr_result, cmp['precision'])
|
attr_expected = round(attr_expected, cmp['precision'])
|
||||||
|
if not attr_result == NULL:
|
||||||
|
attr_result = round(attr_result, cmp['precision'])
|
||||||
|
|
||||||
if use_asserts:
|
if use_asserts:
|
||||||
_TestCase.assertEqual(
|
_TestCase.assertEqual(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user