Adds unit test for ability to pass lambda from Python

Change-Id: I21271650040763cb0db17a55ad6685ba19dbbbfc
This commit is contained in:
Stan Lagun 2016-02-10 18:42:55 +03:00
parent 926162590c
commit bf4f29cda0

View File

@ -20,6 +20,17 @@ import yaql.tests
class TestMiscellaneous(yaql.tests.TestCase):
def test_pass_lambda_from_code(self):
self.assertEqual(
[],
list(self.context('where', self.engine, [1, 2, 3])(False))
)
self.assertEqual(
[2, 3],
list(self.context('where', self.engine, [1, 2, 3])(
lambda t: t > 1))
)
def test_bool_is_not_an_integer(self):
@specs.parameter('arg', yaqltypes.Integer())
def foo(arg):