#NEWLINE# def mock_elastalert( self , elastalert ) : #NEWLINE# #INDENT# " Replaces elastalert's get_hits functions with mocks. " #NEWLINE# elastalert . get_hits_count = self . mock_count #NEWLINE# elastalert . get_hits_terms = self . mock_terms #NEWLINE# elastalert . get_hits = elastalert . mock_hits #NEWLINE# elastalert . new_elasticsearch = mock . Mock ( )