#NEWLINE# @ mock . patch . object ( processutils , 'ssh_execute' , autospec = True ) #NEWLINE# def test__ssh_execute_exception( self , exec_ssh_mock ) : #NEWLINE# #INDENT# ssh_cmd = 'somecmd' #NEWLINE# exec_ssh_mock . side_effect = processutils . ProcessExecutionError #NEWLINE# self . assertRaises ( exception . SSHCommandFailed , ssh . _ssh_execute , self . sshclient , ssh_cmd ) #NEWLINE# exec_ssh_mock . assert_called_once_with ( exec_ssh_mock . sshclient , ssh_cmd )