I need to test many different scenarios of fake json loads. I need to return a fake sample self.jsonload therefore do I need to mock both the self.client.get_json_load and the json_load(f)? And how would I provide the fake sample load?
def get_load(self):
obj = self.client.get_json_load(aws s3 file)
with io.BytesIO(obj.content) as f:
self.jsonload = json.load(f)
return self.jsonload
so when I call get_load(), for another unit test, it will return the fake test load to test different scenarios.