#NEWLINE# @ mock . patch . object ( drac_mgmt , '_get_boot_device' , spec_set = True , autospec = True ) #NEWLINE# def test_get_boot_device( self , mock__get_boot_device , mock_get_drac_client ) : #NEWLINE# #INDENT# expected_boot_device = { #NEWLINE# #INDENT# 'boot_device' : ironic . common . boot_devices . DISK , #NEWLINE# 'persistent' : True , #NEWLINE# #UNINDENT# } #NEWLINE# mock__get_boot_device . return_value = expected_boot_device #NEWLINE# with task_manager . acquire ( self . context , self . node . uuid , shared = True ) as task : #NEWLINE# #INDENT# boot_device = task . driver . management . get_boot_device ( expected_boot_device ) #NEWLINE# self . assertEqual ( expected_boot_device , boot_device ) #NEWLINE# mock__get_boot_device . assert_called_once_with ( task . node )