def test_was_command_successful_false(self):
# Create our fake SSH client
ssh_client = ssh.HPELeftHandSSHClient('foo', 'bar', 'biz')
# Test invalid command output
cmd_out = ['invalid']
self.assertRaises(exceptions.SSHException,
ssh_client.was_command_successful,
cmd_out)
# Test valid command output, but command failed
cmd_out = ['',
'HP StoreVirtual LeftHand OS Command Line Interface',
'(C) Copyright 2007-2013',
'',
'RESPONSE',
' result 8080878378']
self.assertRaises(exceptions.SSHException,
ssh_client.was_command_successful,
cmd_out)
test_HPELeftHandClient_MockSSH.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录