0

I'm having a function which makes 3 get request to fetch file from S3 bucket. So i need to mock them correctly to return an expected result. Below is the code structure

# src.py
def parent(bucket, file):
    json_object = get_object(bucket, file) ## will return a json file from s3.
    csv_buck, csv_key = filter_key(json_object) # reading the content of json file and get the bucket name and key of another csv file located in another bucket
    csv_obj = get_object(csv_buck, csv_key)
    .... #do the other necessary stuffs

and the test file is

# test.py
class TestParent(TestCase):
     
     def test_parent(self):
          ...

So here before implementing testing i need to know is it possible to mock get_object to 2 different scenarios??

ahkam
  • 607
  • 7
  • 24

0 Answers0