def test_builder(self): _yql = _YQLBuilder("user") _yql.filter("name", "sathya") _yql.filter("age", 26, type='integer') actual = "SELECT * FROM user WHERE name = 'sathya' and age = 26" self.assertEqual(_yql.el, actual)
def test_builder_1(self): _yql = _YQLBuilder("user") g = _yql.filter("name","sathya") g.get("age", "page") actual = "SELECT age,page FROM user WHERE name = 'sathya'" self.assertEqual(_yql.el, actual) self.assertNotEqual(_yql.el, actual)
def test_builder_1(self): _yql = _YQLBuilder("user") g = _yql.filter("name", "sathya") g.get("age", "page") actual = "SELECT age,page FROM user WHERE name = 'sathya'" self.assertEqual(_yql.el, actual) self.assertNotEqual(_yql.el, actual)
def __init__(self, *args, **kwargs): """ Object block consistes of a table name and builder get initialised for constructing the quries. """ self.__tablename = kwargs.pop('table', None) self.__yql = _YQLBuilder(self.__tablename) super(_Api_Request, self).__init__(*args, **kwargs)