':py:meth:`PKeyType.check` raises :py:exc:`TypeError` if only the public
part of the key is available.'

def test_check_public_key(self):

    key = PKey()
    key.generate_key(TYPE_RSA, 512)
    cert = X509()
    cert.set_pubkey(key)
    pub = cert.get_pubkey()
    self.assertRaises(TypeError, pub.check)
