All Questions
Tagged with python-unittest.mock amazon-web-services
4 questions
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 = ...
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 ...
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 ...
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 ...