def test_greater_equal(self): for greater in [ GreaterEqual(self.table.c1, self.table.c2), self.table.c1 >= self.table.c2, ~Less(self.table.c1, self.table.c2) ]: self.assertEqual(str(greater), '("c1" >= "c2")') self.assertEqual(greater.params, ())
def test_less(self): for less in [Less(self.table.c1, self.table.c2), self.table.c1 < self.table.c2, ~GreaterEqual(self.table.c1, self.table.c2)]: self.assertEqual(str(less), '("c1" < "c2")') self.assertEqual(less.params, ()) less = Less(Literal(0), self.table.c2) self.assertEqual(str(less), '(%s < "c2")') self.assertEqual(less.params, (0,))
def __ge__(self, other): from sql.operators import GreaterEqual return GreaterEqual(self, other)