#NEWLINE# @ mock . patch . object ( event_utils , 'poll_for_events' ) #NEWLINE# @ mock . patch . object ( template_utils , 'get_template_contents' ) #NEWLINE# @ mock . patch . object ( shade . OpenStackCloud , 'get_stack' ) #NEWLINE# @ mock . patch . object ( shade . OpenStackCloud , 'heat_client' ) #NEWLINE# def test_update_stack_wait( self , mock_heat , mock_get , mock_template , mock_poll ) : #NEWLINE# #INDENT# stack = { #NEWLINE# #INDENT# 'id' : 'stack_id' , #NEWLINE# 'name' : 'stack_name' , #NEWLINE# #UNINDENT# } #NEWLINE# mock_template . return_value = ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# mock_get . return_value = stack #NEWLINE# ret = self . cloud . update_stack ( 'stack_name' , wait = True ) #NEWLINE# self . assertTrue ( self . called ) #NEWLINE# mock_heat . stacks . update . assert_called_once_with ( stack_id = 'stack_name' , disable_rollback = False , environment = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , parameters = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , template = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , files = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , timeout_mins = 60 ) #NEWLINE# self . assertEqual ( 1 , mock_get . call_count ) #NEWLINE# self . assertEqual ( 1 , mock_poll . call_count ) #NEWLINE# self . assertEqual ( stack , ret )