#NEWLINE# @ mock . patch . object ( ilo_power , '_set_power_state' , spec_set = True , autospec = True ) #NEWLINE# def test_set_power_state( self , mock_set_power ) : #NEWLINE# #INDENT# mock_set_power . return_value = states . POWER_ON #NEWLINE# with task_manager . acquire ( self . context , self . node . uuid , shared = False ) as task : #NEWLINE# #INDENT# task . driver . power . set_power_state ( self , states . POWER_ON ) #NEWLINE# #UNINDENT# mock_set_power . assert_called_once_with ( task , states . POWER_ON )