I am trying to mock AWS service in python.
Usually, I mock AWS service which is defined globally.
But is it possible to mock, if it is defined inside the function?
eg.
def somefunction(replication_region):
s3 = boto3.client("s3", region_name=replication_region)
This is a common function, which will be invoked if there are replication region is present for s3, if replication region is not present, then only one region will be executed.
So this variable is not defined globally.