#NEWLINE# def test_table_is_reflected( self ) : #NEWLINE# #INDENT# from sqlalchemy.types import Integer , Text , BLOB , String , Date , Time , DateTime #NEWLINE# metadata = MetaData ( testing . db ) #NEWLINE# table = Table ( 'testtable' , metadata , autoload = True ) #NEWLINE# eq_ ( set ( table . columns . keys ( ) ) , set ( [ 'question' , 'answer' , 'remark' , 'photo' , 'd' , 't' , 'dt' , 'redundant' ] ) , "Columns of reflected table didn't equal expected columns" ) #NEWLINE# eq_ ( table . c . question . primary_key , True ) #NEWLINE# assert isinstance ( table . c . question . type , Integer ) #NEWLINE# eq_ ( table . c . question . server_default . arg . text , '42' ) #NEWLINE# assert isinstance ( table . c . answer . type , String ) #NEWLINE# assert ( table . c . answer . type . length == 255 ) #NEWLINE# eq_ ( table . c . answer . server_default . arg . text , "'no answer'" ) #NEWLINE# assert isinstance ( table . c . remark . type , Text ) #NEWLINE# eq_ ( table . c . remark . server_default . arg . text , "''" ) #NEWLINE# assert isinstance ( table . c . photo . type , BLOB ) #NEWLINE# assert ( table . c . redundant . server_default is None ) #NEWLINE# assert isinstance ( table . c . d . type , Date ) #NEWLINE# assert isinstance ( metadata . c . t . type , Time ) #NEWLINE# assert isinstance ( table . c . dt . type , DateTime )