def testBetween(self): b = q.between(1, 10) self.assertEqual('[1 10]', str(b)) b = q.between(None, 10) self.assertEqual('[-inf 10]', str(b)) b = q.between(1, 10, inclusive_min=False) self.assertEqual('[(1 10]', str(b))
def testSpecialNodes(self): u = q.union(num=q.between(1, 10)) self.assertEqual('@num:[1 10]', str(u)) u = q.union(num=[q.between(1, 10), q.between(100, 200)]) self.assertEqual('(@num:[1 10]|@num:[100 200])', str(u)) u = q.union( num=[q.tags('t1', 't2', 't3'), q.tags('t100', 't200', 't300')]) self.assertEqual('(@num:{t1 | t2 | t3}|@num:{t100 | t200 | t300})', str(u))