Skip to content
Permalink
Browse files

Fix failing expression test

  • Loading branch information
NathanW2 committed May 27, 2015
1 parent f234810 commit 26e6725af6d17d7af6987fb330346fb137ec2e8d
Showing with 7 additions and 3 deletions.
  1. +7 −3 tests/src/python/test_qgsexpression.py
@@ -31,7 +31,7 @@ def autocount(value1, value2, value3, feature, parent):
def expandargs(value1, value2, value3, feature, parent):
return value1, value2, value3

@qgsfunction(0, 'testing', register=False)
@qgsfunction(args=0, group='testing', register=False)
def special(values, feature, parent):
return "test"

@@ -82,9 +82,13 @@ def testCanEvaluateFunction(self):
result = exp.evaluate()
self.assertEqual('Testing_1', result)

def testZeroArgFunctionsAreSpecialColumns(self):
def testZeroArgFunctionsTakeNoArgs(self):
QgsExpression.registerFunction(self.special)
special = self.special
self.assertEqual(special.name(), '$special')
self.assertEqual(special.name(), 'special')
exp = QgsExpression('special()')
result = exp.evaluate()
self.assertEqual('test', result)

def testDecoratorPreservesAttributes(self):
func = self.testfun

0 comments on commit 26e6725

Please sign in to comment.