In order to simplify my question, consider the following code:
How do you write test for function foo1 with patching\mocking the S3Downloader.read_file part?
I prefer you will show me example usage of pytest-mock or even unitest.mock
from sagemaker.s3 import S3Downloader
class Fooer(object):
@staticmethod
def foo1(s3_location):
s3_content = S3Downloader.read_file(s3_location)
return Fooer.foo2(s3_content)
@staticmethod
def foo2(s3_content):
return s3_content +"_end"