I have a test file status_update/tests/test_status_update.py which has the following content
` from lib.sync_mdl_status import update_mdl_status
@patch('scripts.aws_secrets.fetch_aws_secret')
def test_status_updater_mdl(self, new=MockFetchAwsSecrets()):
db_ops_testing_insert_requests(TEST_FILE)
db_ops_testing_insert_table_info(TABLE_INFO_FILE)
db_ops_testing_insert_batch(BATCH_DATA_FILE)
db_ops_testing_insert_mdl_work_requests(MDL_WORK_REQUESTS_DATA_FILE)
db_ops_testing_insert_batch_table_mapping(BTM_DATA_FILE)
db_ops_testing_insert_mdlendpoint_info(MDL_ENDPOINT_FILE)
update_mdl_status(self.postgresql.url(), "test", 1, "roe-api-secrets")`
The update_mdl_status function is inside status_update/lib/sync_mdl_status. The update_mdl_status inturn calls a function fetch_aws_secret from scripts/aws_secrets.py.
I have mocked the fetch_aws_secret function but the mock doesnt work and it tries to access the aws secret url and fails. Why does the mock not work.
status_update and scripts folders are on same level.
Tried mocking using patch and magic mock but it doesnt worK