def test_credentialsInvalidSignature(self):
        """
        Calling L{checkers.SSHPublicKeyChecker.requestAvatarId} with
        credentials that are incorrectly signed fails with
        L{UnauthorizedLogin}.
        """
        self.credentials.signature = (
            keys.Key.fromString(keydata.privateDSA_openssh).sign(b'foo'))
        self.failureResultOf(self.checker.requestAvatarId(self.credentials),
                             UnauthorizedLogin)

        Calling L{checkers.SSHPublicKeyChecker.requestAvatarId} with
        credentials that are incorrectly signed fails with
        L{UnauthorizedLogin}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_checkers.py