':py:obj:`Context.use_privatekey` takes an :py:obj:`OpenSSL.crypto.PKey` instance.'

def test_use_privatekey(self):

    key = PKey()
    key.generate_key(TYPE_RSA, 128)
    ctx = Context(TLSv1_METHOD)
    ctx.use_privatekey(key)
    self.assertRaises(TypeError, ctx.use_privatekey, '')
