#NEWLINE# def test_probas( self , PredictService , flask_app ) : #NEWLINE# #INDENT# model = Mock ( ) #NEWLINE# model . predict_proba . return_value = np . array ( [ [ 0.1 , 0.5 , math . pi ] ] ) #NEWLINE# predict_service = PredictService ( mapping = [ ] , predict_proba = True ) #NEWLINE# with flask_app . test_request_context ( ) : #NEWLINE# #INDENT# resp = predict_service ( PredictService , request ) #NEWLINE# #UNINDENT# resp_data = json . loads ( resp . get_data ( as_text = True ) ) #NEWLINE# assert ( resp . status_code == 200 ) #NEWLINE# assert ( resp_data == { #NEWLINE# #INDENT# 'metadata' : { #NEWLINE# #INDENT# 'status' : 'OK' , #NEWLINE# 'error_code' : 0 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'result' : [ 0.1 , 0.5 , math . pi ] , #NEWLINE# #UNINDENT# } )