'ssh_USERAUTH_REQUEST should raise a ConchError if tryAuth returns
None. Added to catch a bug noticed by pyflakes.'

def test_requestRaisesConchError(self):

    d = defer.Deferred()
    def mockCbFinishedAuth(self, ignored):
        self.fail('request    should    have    raised    ConochError')
    def mockTryAuth(kind, user, data):
        return None
    def mockEbBadAuth(reason):
        d.errback(reason.value)
    self.patch(self.authServer, 'tryAuth', mockTryAuth)
    self.patch(self.authServer, '_cbFinishedAuth', mockCbFinishedAuth)
    self.patch(self.authServer, '_ebBadAuth', mockEbBadAuth)
    packet = (((NS('user') + NS('none')) + NS('public-key')) + NS('data'))
    self.authServer.ssh_USERAUTH_REQUEST(packet)
    return self.assertFailure(d, ConchError)
