mucket

Mock whole S3 buckets


License
MIT-feh
Install
pip install mucket==0.1.0

Documentation

Mucket

Use this class to temporarily mock a whole Boto bucket. Is pretty much an S3 mock, except you cannot create buckets, replace or delete objects. Only PUT, GET and HEAD for keys, and GET for buckets are supported. Check out moto for a full blown AWS mock solution.

Install

$ pip install mucket

Usage

>>> from boto import connect_s3
>>> with Mucket('uglubolli'):
...     key = connect_s3().get_bucket('uglubolli').get_key('/bukolli.json')
...     key.set_contents_from_string('{a: 1}', {}, replace=True)
...     print key.get_contents_as_string()
...
{a: 1}
>>>

Drawbacks

  • Does not support query arguments in URL’s (just strip them out, usually it’s just used for cache busting or ephemeral access tokens).