Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_op(self):
instance = SQLOp('and', 'this', 'that')
self.assertEqual(sqlrepr(instance), repr(instance))
def AND(*ops):
if not ops:
return None
op1 = ops[0]
ops = ops[1:]
if ops:
return SQLOp("AND", op1, AND(*ops))
else:
return op1
def __rfloordiv__(self, other):
return SQLConstant("FLOOR")(SQLOp("/", other, self))
def __ne__(self, other):
if other is None:
return ISNOTNULL(self)
else:
return SQLOp("<>", self, other)
def ISNULL(expr):
return SQLOp("IS", expr, None)
def OR(*ops):
if not ops:
return None
op1 = ops[0]
ops = ops[1:]
if ops:
return SQLOp("OR", op1, OR(*ops))
else:
return op1
def __sub__(self, other):
return SQLOp("-", self, other)
def __gt__(self, other):
return SQLOp(">", self, other)
def _IN(item, list):
return SQLOp("IN", item, list)