Replies: 2 comments 7 replies
-
Hi @couling! The simple answer: yes, there is only one official/supported way to access S3 objects. We are in the process of releasing Moto v5, which should have much better performance. Are you able to upgrade to |
Beta Was this translation helpful? Give feedback.
-
It is possible to use internal API to upload all files to S3. But note that, as it is internal, the API will change/break without warning. So use at your own risk. The benefit is that you can skip the boto3-initialization/validation for these operations, which tends to take a lot of time. The
|
Beta Was this translation helpful? Give feedback.
-
Is access to S3 objects only possible via the API. For testing purposes is there any way to access (read or write) S3 objects without going through boto3?
Using Moto to unit test S3 clients is great! The one problem I run into is test performance with 20 to 100ms per test spent primarily on pytest setup executing boto3 requests to moto.
I have a test fixture which requires an S3 bucket to be pre-populated with a bunch of static files and the tests then tests themselves mutate those static files. The setup currently needs to
create_bucket
execute a bunch ofput_object
. While this may only take 50ms per test, that's a lot of time when running a lot of parameterised tests.I was wondering if, when using the
with moto.mock_s3
, there's any way to get files in through a back door, or likewise get a dump of everything rapidly.Is my only option to talk to moto via boto3, or is there something quicker for bulk transfers?
Beta Was this translation helpful? Give feedback.
All reactions