All Questions
Tagged with python-unittest.mock boto3
4 questions
0
votes
1
answer
1k
views
How to patch Boto3.resource DynamoDb Table within a pytest test method
I'm trying to use this answer as an example to test that a dynamo table is not written to.
Because I am using moto to test my reads & writes, I have to do the import inside the test case. I ...
0
votes
0
answers
47
views
How to mock a function which is called several times within a parent function, Python3?
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, ...
2
votes
0
answers
730
views
Mock Boto3 AWS calls where client is global
I have some code that I am attempting to write unit tests for. I have looked at other answers here e.g. here although I have the problem that the Boto3 client reference is global and outside of the ...
0
votes
0
answers
2k
views
Mock unit test for Python boto3 for AWS S3
I'm currently learning how to write unit test for boto3
I'm trying to follow the moto documentation and have written a few lines for the unit test but it gave me error:
@mock_s3
def ...