

def test_description(self):
    con = self._connect()
    try:
        cur = self.cursor()
        self.executeDDL1(cur)
        self.assertEqual(cur.description, None, 'cursor.description should be none after executing a statement that can return no rows (such as DDL)')
        cur.execute(('select name from %sbooze' % self.table_prefix))
        self.assertEqual(len(cur.description), 1, 'cursor.description describes too many columns')
        self.assertEqual(len(cur.description[0]), 7, 'cursor.description[x] tuples must have 7 elements')
        self.assertEqual(cur.description[0][0].lower(), 'name', 'cursor.description[x][0] must return column name')
        self.assertEqual(cur.description[0][1], self.driver.STRING, ('cursor.description[x][1] must return column type. Got %r' % cur.description[0][1]))
        self.executeDDL2(cur)
        self.assertEqual(cur.description, None, 'cursor.description not being set to None when executing no-result statements (eg. DDL)')
    finally:
        con.close()

dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/MySQL-python-1.2.5/tests/dbapi20.py DatabaseAPI20Test.test_description/VarMisuse@24/28 `con`->`self`