#NEWLINE# def test_predict_functional( self , config , flask_app , flask_client ) : #NEWLINE# #INDENT# from palladium.server import make_ujson_response #NEWLINE# model_persister = config [ 'model_persister' ] = Mock ( ) #NEWLINE# predict_service = config [ 'predict_service' ] = Mock ( ) #NEWLINE# with flask_app . test_request_context ( ) : #NEWLINE# #INDENT# predict_service . return_value = make_ujson_response ( 'a' , status_code = 200 ) #NEWLINE# #UNINDENT# model = model_persister . read ( ) #NEWLINE# resp = flask_client . get ( 'predict?sepal length=1.0&sepal width=1.1&petal length=0.777&petal width=5' ) #NEWLINE# resp_data = json . loads ( resp . get_data ( as_text = True ) ) #NEWLINE# assert ( resp_data == 'a' ) #NEWLINE# assert ( resp . status_code == 200 ) #NEWLINE# with flask_app . test_request_context ( ) : #NEWLINE# #INDENT# predict_service . assert_called_with ( flask_app , request )