'Test that private key authentication completes successfully,'

def test_successfulPrivateKeyAuthentication(self):

    blob = keys.Key.fromString(keydata.publicRSA_openssh).blob()
    obj = keys.Key.fromString(keydata.privateRSA_openssh)
    packet = (((((NS('foo') + NS('none')) + NS('publickey')) + '\xff') + NS(obj.sshType())) + NS(blob))
    self.authServer.transport.sessionID = 'test'
    signature = obj.sign(((NS('test') + chr(userauth.MSG_USERAUTH_REQUEST)) + packet))
    packet += NS(signature)
    d = self.authServer.ssh_USERAUTH_REQUEST(packet)
    def check(ignored):
        self.assertEqual(self.authServer.transport.packets, [(userauth.MSG_USERAUTH_SUCCESS, '')])
    return d.addCallback(check)
