def test_successfulPrivateKeyAuthentication(self):
        """
        Test that private key authentication completes successfully,
        """
        blob = keys.Key.fromString(keydata.publicRSA_openssh).blob()
        obj = keys.Key.fromString(keydata.privateRSA_openssh)
        packet = (NS(b'foo') + NS(b'none') + NS(b'publickey') + b'\xff'
                + NS(obj.sshType()) + NS(blob))
        self.authServer.transport.sessionID = b'test'
        signature = obj.sign(NS(b'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, b'')])
        return d.addCallback(check)

        Test that private key authentication completes successfully,
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_userauth.py