#NEWLINE# def test_dict_factory( self ) : #NEWLINE# #INDENT# session = self . session #NEWLINE# session . row_factory = dict_factory #NEWLINE# session . execute ( self . insert1 ) #NEWLINE# session . execute ( self . insert2 ) #NEWLINE# result = session . execute ( self . select ) #NEWLINE# self . assertIsInstance ( result , ResultSet ) #NEWLINE# self . assertIsInstance ( result [ 0 ] , dict ) #NEWLINE# for row in result : #NEWLINE# #INDENT# self . assertEqual ( row [ 'k' ] , row [ 'v' ] ) #NEWLINE# #UNINDENT# self . assertEqual ( result [ 0 ] [ 'k' ] , result [ 0 ] [ 'v' ] ) #NEWLINE# self . assertEqual ( result [ 0 ] [ 'k' ] , 1 ) #NEWLINE# self . assertEqual ( result [ 1 ] [ 'k' ] , result [ 1 ] [ 'v' ] ) #NEWLINE# self . assertEqual ( result [ 1 ] [ 'k' ] , 2 )