def test_requestAvatarId(self):
        """
        L{SSHPublicKeyDatabase.requestAvatarId} should return the avatar id
        passed in if its C{_checkKey} method returns True.
        """
        def _checkKey(ignored):
            return True
        self.patch(self.checker, 'checkKey', _checkKey)
        credentials = SSHPrivateKey(
            b'test', b'ssh-rsa', keydata.publicRSA_openssh, b'foo',
            keys.Key.fromString(keydata.privateRSA_openssh).sign(b'foo'))
        d = self.checker.requestAvatarId(credentials)
        def _verify(avatarId):
            self.assertEqual(avatarId, b'test')
        return d.addCallback(_verify)

        L{SSHPublicKeyDatabase.requestAvatarId} should return the avatar id
        passed in if its C{_checkKey} method returns True.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_checkers.py