<s> import capabilities <EOL> import unittest <EOL> import MySQLdb <EOL> import warnings <EOL> warnings . filterwarnings ( '<STR_LIT:ignore>' ) <EOL> class test_MySQLdb ( capabilities . DatabaseTest ) : <EOL> db_module = MySQLdb <EOL> connect_args = ( ) <EOL> connect_kwargs = dict ( use_unicode = True , sql_mode = "<STR_LIT>" ) <EOL> create_table_extra = "<STR_LIT>" <EOL> leak_test = False <EOL> def quote_identifier ( self , ident ) : <EOL> return "<STR_LIT>" % ident <EOL> def test_TIME ( self ) : <EOL> from datetime import timedelta <EOL> def generator ( row , col ) : <EOL> return timedelta ( <NUM_LIT:0> , row * <NUM_LIT> ) <EOL> self . check_data_integrity ( <EOL> ( '<STR_LIT>' , ) , <EOL> generator ) <EOL> def test_TINYINT ( self ) : <EOL> def generator ( row , col ) : <EOL> v = ( row * row ) % <NUM_LIT> <EOL> if v > <NUM_LIT> : <EOL> v = v - <NUM_LIT> <EOL> return v <EOL> self . check_data_integrity ( <EOL> ( '<STR_LIT>' , ) , <EOL> generator ) <EOL> def test_stored_procedures ( self ) : <EOL> db = self . connection <EOL> c = self . cursor <EOL> self . create_table ( ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> c . executemany ( "<STR_LIT>" % self . table , <EOL> list ( enumerate ( '<STR_LIT>' . split ( ) ) ) ) <EOL> db . commit ( ) <EOL> c . execute ( """<STR_LIT>""" % self . table ) <EOL> db . commit ( ) <EOL> c . callproc ( '<STR_LIT>' , ( '<STR_LIT>' , ) ) <EOL> rows = c . fetchall ( ) <EOL> self . assertEquals ( len ( rows ) , <NUM_LIT:1> ) <EOL> self . assertEquals ( rows [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] , <NUM_LIT:3> ) <EOL> c . nextset ( ) <EOL> c . execute ( "<STR_LIT>" ) <EOL> c . execute ( '<STR_LIT>' % ( self . table ) ) <EOL> def test_small_CHAR ( self ) : <EOL> def generator ( row , col ) : <EOL> i = ( row * col + <NUM_LIT> ) % <NUM_LIT> <EOL> if i == <NUM_LIT> : return '<STR_LIT>' <EOL> if i == <NUM_LIT> : return None <EOL> return chr ( i ) <EOL> self . check_data_integrity ( <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> generator ) <EOL> def test_bug_2671682 ( self ) : <EOL> from MySQLdb . constants import ER <EOL> try : <EOL> self . cursor . execute ( "<STR_LIT>" ) ; <EOL> except self . connection . ProgrammingError , msg : <EOL> self . assertEquals ( msg [ <NUM_LIT:0> ] , ER . NO_SUCH_TABLE ) <EOL> def test_bug_3514287 ( self ) : <EOL> c = self . cursor <EOL> try : <EOL> c . execute ( """<STR_LIT>""" ) <EOL> c . execute ( "<STR_LIT>" , <EOL> ( "<STR_LIT>" , ) ) <EOL> finally : <EOL> c . execute ( "<STR_LIT>" ) <EOL> def test_ping ( self ) : <EOL> self . connection . ping ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> if test_MySQLdb . leak_test : <EOL> import gc <EOL> gc . enable ( ) <EOL> gc . set_debug ( gc . DEBUG_LEAK ) <EOL> unittest . main ( ) </s>
