#NEWLINE# @ patch ( 'nefertari.elasticsearch.engine' ) #NEWLINE# @ patch ( 'nefertari.elasticsearch.elasticsearch' ) #NEWLINE# def test_setup_no_settings( self , mock_es , mock_engine ) : #NEWLINE# #INDENT# settings = dictset ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# with pytest . raises ( Exception ) as ex : #NEWLINE# #INDENT# es . ES . setup ( settings ) #NEWLINE# #UNINDENT# assert ( 'Bad or missing settings for elasticsearch' in str ( ex . value ) ) #NEWLINE# assert ( not mock_es . Elasticsearch . called )