#NEWLINE# @ responses . activate #NEWLINE# def test_custom_extract( self ) : #NEWLINE# #INDENT# def custom_extract( resp ) : #NEWLINE# #INDENT# return resp . json ( ) #NEWLINE# #UNINDENT# responses . add ( responses . GET , 'https://maps.googleapis.com/bar' , body = '{"error":"errormessage"}' , status = 403 , content_type = 'application/json' ) #NEWLINE# client = googlemaps . Client ( key = 'AIzaasdf' ) #NEWLINE# b = client . _get ( '/bar' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , extract_body = custom_extract ) #NEWLINE# self . assertEqual ( 1 , len ( responses . calls ) ) #NEWLINE# self . assertEqual ( 'errormessage' , b [ 'error' ] )