#NEWLINE# @ mock . patch . object ( drac_mgmt , '_get_boot_device' , spec_set = True , autospec = True ) #NEWLINE# @ mock . patch . object ( drac_job , 'validate_job_queue' , spec_set = True , autospec = True ) #NEWLINE# def test_set_boot_device_called_with_no_change( self , mock_validate_job_queue , mock__get_boot_device , mock_get_drac_client ) : #NEWLINE# #INDENT# mock_client = mock . Mock ( ) #NEWLINE# mock_get_drac_client . return_value = mock_client #NEWLINE# mock_client . list_boot_modes . return_value = [ mock . Mock ( ** self . boot_mode_ipl ) , mock . Mock ( ** mock_client . boot_mode_one_time ) ] #NEWLINE# mock_client . list_boot_devices . return_value = { #NEWLINE# #INDENT# 'IPL' : [ mock . Mock ( ** self . boot_device_pxe ) , mock . Mock ( ** self . boot_device_disk ) ] , #NEWLINE# #UNINDENT# } #NEWLINE# boot_device = { #NEWLINE# #INDENT# 'boot_device' : ironic . common . boot_devices . PXE , #NEWLINE# 'persistent' : True , #NEWLINE# #UNINDENT# } #NEWLINE# mock__get_boot_device . return_value = boot_device #NEWLINE# boot_device = drac_mgmt . set_boot_device ( self . node , ironic . common . boot_devices . PXE , persistent = True ) #NEWLINE# mock_validate_job_queue . assert_called_once_with ( self . node ) #NEWLINE# self . assertEqual ( 0 , mock_client . change_boot_device_order . call_count ) #NEWLINE# self . assertEqual ( 0 , mock_client . commit_pending_bios_changes . call_count )