coveooss/coveo-python-oss

coveo-ref // unsupported case #1

jonapich opened this issue · 0 comments

This happens with the jwt library.

source: https://github.com/jpadilla/pyjwt/blob/6f1269246f5536e433011532ff372adeb3581138/jwt/api_jwt.py#L376

_jwt_global_obj = PyJWT()
encode = _jwt_global_obj.encode
decode_complete = _jwt_global_obj.decode_complete
decode = _jwt_global_obj.decode

These are then imported in their __init__.py (from .api_jwt import PyJWT, decode, encode).

Then projects import/use it as such:

# moduletotest.py
import jwt
_ = jwt.decode(...)

I wasn't able to find a way to resolve this with ref, but the hardcoded patch works:

@patch("moduletotest.jwt.decode", return_value={'jti': 'test'})