#NEWLINE# @ mock . patch . object ( seamicro , '_power_on' , autospec = True ) #NEWLINE# def test_set_power_state_on_good( self , mock_power_on ) : #NEWLINE# #INDENT# mock_power_on . return_value = states . POWER_ON #NEWLINE# with task_manager . acquire ( self . context , self . info [ 'uuid' ] , shared = False ) as task : #NEWLINE# #INDENT# task . driver . power . set_power_state ( self , states . POWER_ON ) #NEWLINE# mock_power_on . assert_called_once_with ( task . node )