예제 #1
0
def test_initialize_sql(db):
    good_sql = 'SELECT * FROM %s' % TBL
    bad_sql = 'ALTER TABLE %s ADD "newcol" varchar' % TBL

    assert isinstance(database.initialize_sql(db, good_sql), str)
    with pytest.raises(AttributeError):
        database.initialize_sql(db, bad_sql)
예제 #2
0
def test_initialize_sql(db):
    good_sql = 'SELECT * FROM %s' % TBL
    bad_sql = 'ALTER TABLE %s ADD "newcol" varchar' % TBL

    assert isinstance(database.initialize_sql(db, good_sql), str)
    with pytest.raises(AttributeError):
        database.initialize_sql(db, bad_sql)
예제 #3
0
    def initialize(self, db, sql):

        self.sql = sql
        self.select = database.initialize_sql(db, sql)
        self.db = db
예제 #4
0
    def initialize(self, db, sql):

        self.sql = sql
        self.select = database.initialize_sql(db, sql)
        self.db = db