#NEWLINE# @ mock . patch ( 'nova.objects.Instance.save' ) #NEWLINE# def _test_evacuate_enable_instance_password_conf( self , mock_save , enable_pass ) : #NEWLINE# #INDENT# self . flags ( enable_instance_password = enable_pass ) #NEWLINE# res = self . _get_evacuate_response ( { #NEWLINE# #INDENT# 'host' : 'underscore_hostname' , #NEWLINE# 'onSharedStorage' : 'False' , #NEWLINE# #UNINDENT# } ) #NEWLINE# if enable_pass : #NEWLINE# #INDENT# self . assertIn ( 'adminPass' , res ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . assertIsNone ( res . get ( 'adminPass' ) )