test_HPELeftHandClient_MockSSH.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:deb-python-hplefthandclient 作者: openstack 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号