def test_sum(self): q = query.query(self.idx, { 'equal': ['sexe', True] }) q = query.query(self.idx, { 'sum':['age', { 'equal': ['sexe', True] }] }) self.assertEqual(42 + 74, q)
def test_parsing(self): q = query.query(self.idx, { 'and': [ {'equal': ['location', 'Paris']}, {'more_than': ['age', 37]} ]}) self.assertEqual(intbitset([1, 3]), q)
def test_parsing(self): q = query.query(self.idx, { 'and': [{ 'equal': ['location', 'Paris'] }, { 'more_than': ['age', 37] }] }) self.assertEqual(intbitset([1, 3]), q)
def test_sum(self): q = query.query(self.idx, {'equal': ['sexe', True]}) q = query.query(self.idx, {'sum': ['age', {'equal': ['sexe', True]}]}) self.assertEqual(42 + 74, q)