示例#1
0
 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)
示例#2
0
 def test_parsing(self):
     q = query.query(self.idx, {
         'and': [
             {'equal': ['location', 'Paris']},
             {'more_than': ['age', 37]}
         ]})
     self.assertEqual(intbitset([1, 3]), q)
示例#3
0
 def test_parsing(self):
     q = query.query(self.idx, {
         'and': [{
             'equal': ['location', 'Paris']
         }, {
             'more_than': ['age', 37]
         }]
     })
     self.assertEqual(intbitset([1, 3]), q)
示例#4
0
 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)