#NEWLINE# @ patch ( 'prestoadmin.prestoclient.urlopen' ) #NEWLINE# @ patch ( 'httplib.HTTPResponse' ) #NEWLINE# def test_get_response( self , mock_resp , mock_urlopen ) : #NEWLINE# #INDENT# client = PrestoClient ( 'any_host' , 'any_user' ) #NEWLINE# mock_urlopen . return_value = self #NEWLINE# mock_resp . read . return_value = '{"message": "ok!"}' #NEWLINE# client . get_response_from ( 'any_uri' ) #NEWLINE# self . assertEqual ( client . response_from_server , { #NEWLINE# #INDENT# 'message' : 'ok!' , #NEWLINE# #UNINDENT# } )