#NEWLINE# def test_blacklist_error( self ) : #NEWLINE# #INDENT# msg = " : Config file has an include or exclude reference to legacy test '%s' but no configuration data for it. Configuration data is required for this test. Please consider switching to the new config file format, the tool 'bandit-config-generator' can help you with this." #NEWLINE# for name in [ 'blacklist_call' , 'blacklist_imports' , 'blacklist_imports_func' ] : #NEWLINE# #INDENT# self . config . _config = { #NEWLINE# #INDENT# 'profiles' : { #NEWLINE# #INDENT# 'test' : { #NEWLINE# #INDENT# 'include' : [ name ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# try : #NEWLINE# #INDENT# self . config . validate ( '' ) #NEWLINE# #UNINDENT# except utils . ConfigError as e : #NEWLINE# #INDENT# self . assertEqual ( ( msg % name ) , e . message )