def test_fromLSHPublicUnsupportedType(self):
        """
        C{BadKeyError} exception is raised when public key has an unknown
        type.
        """
        sexp = sexpy.pack([[b'public-key', [b'bad-key', [b'p', b'2']]]])

        self.assertRaises(
            keys.BadKeyError,
            keys.Key.fromString, data=b'{' + base64.encodestring(sexp) + b'}',
            )

        C{BadKeyError} exception is raised when public key has an unknown
        type.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_keys.py