Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
429 views

unittest in python not working as expected

We are deploying the code in CI/CD fashion via Terraform. So, we have a lambda function under which I have written a code for retrieving the specific secret creds. Below is my lambda code: logger = ...
whatsinthename's user avatar
1 vote
0 answers
262 views

My AWS lambda in python. It downloads a file from S3 and reads that file. Now I need to write a unittest mock test for that

I have an AWS lambda written in python. The lambda downloads a file from S3 to the folder /tmp/records. Then the lambda reads that file. Now I need to write a unit test for that. I need to mock the S3 ...
srinin's user avatar
  • 83
4 votes
1 answer
3k views

How to mock config variables in python3?

This is a AWS lambda function #service.py from configs import SENDER, DESTINATIONS from constants import LOG_FORMAT import logging def send_mail(body, SENDER, DESTINATIONS): ... ... In ...
ahkam's user avatar
  • 767
1 vote
0 answers
159 views

python - mock module AND the method

I'm writing a unit test for aws serverless using lambda layers. I need to run test in a CI/CD. This means, the layer - utils.py module is NOT available during the test. I need to: mock MODULE mock ...
Janicko's user avatar
  • 11