#NEWLINE# def test_set_power_state_off_timeout( self , mock_get_driver ) : #NEWLINE# #INDENT# mock_driver = mock_get_driver . return_value #NEWLINE# mock_driver . power_off . return_value = states . ERROR #NEWLINE# with task_manager . acquire ( mock_get_driver . context , self . node . uuid ) as task : #NEWLINE# #INDENT# self . assertRaises ( exception . PowerStateFailure , task . driver . power . set_power_state , task , states . POWER_OFF ) #NEWLINE# #UNINDENT# mock_driver . power_off . assert_called_once_with ( )