I have a flask application, in which I use "flask-caching" with redis. I save some values in the cache and retrieve it for processing. I have to write unittest for this. How can I mock the redis instance and pass the host for that server in the flask caching config.
I did try "fakeredis", but that does not give me the redis host, which I can use in flask caching and test my application.
How can I go about writing unit test cases for this ?
def func_1():
# some steps
x = func2() # this is where the code for flask caching (redis) data retrieval is
# process x
I have to test func_1()