#NEWLINE# @ mock . patch ( 'sahara.plugins.ambari.client.context' ) #NEWLINE# def test_wait_ambari_request_error( self , mock_context ) : #NEWLINE# #INDENT# client = ambari_client . AmbariClient ( self . instance ) #NEWLINE# check_mock = mock . MagicMock ( ) #NEWLINE# d1 = { #NEWLINE# #INDENT# 'request_context' : 'r1' , #NEWLINE# 'request_status' : 'ERROR' , #NEWLINE# 'progress_percent' : 146 , #NEWLINE# #UNINDENT# } #NEWLINE# check_mock . return_value = check_mock #NEWLINE# client . check_request_status = check_mock #NEWLINE# self . assertRaises ( p_exc . HadoopProvisionError , client . wait_ambari_request , 'id1' , 'c1' )