':py:meth:`X509Req.sign` raises :py:exc:`ValueError` when pass a
:py:class:`PKey` with no private part as the signing key.'

def test_signWithPublicKey(self):

    request = self.signable()
    key = PKey()
    key.generate_key(TYPE_RSA, 512)
    request.set_pubkey(key)
    pub = request.get_pubkey()
    self.assertRaises(ValueError, request.sign, pub, GOOD_DIGEST)
