'Get the password using
L{twisted.conch.client.default.SSHUserAuthClient.getPassword}
and trigger a {twisted.conch.error import ConchError}.'

def test_getPasswordConchError(self):

    options = ConchOptions()
    client = SSHUserAuthClient('user', options, None)
    def getpass(prompt):
        raise KeyboardInterrupt('User    pressed    CTRL-C')
    self.patch(default.getpass, 'getpass', getpass)
    (stdout, stdin) = (sys.stdout, sys.stdin)
    d = client.getPassword('?')
    @d.addErrback
    def check_sys(fail):
        self.assertEqual([stdout, stdin], [sys.stdout, sys.stdin])
        return fail
    self.assertFailure(d, ConchError)
