Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect boto with fakes3

I'm wondering how I connect boto to fakes3 for integration testing.

I'm currently running fakes3 like so:

fakes3 -r fakes3 -p 4567

and attempting to connect to s3 and creating a bucket in ipython like this:

s3conn = S3Connection(access_key_id, secret_access_key, port=4567, host='localhost')
bucket = s3conn.create_bucket('test')

This just hangs. Can someone give me an example o connecting to fakes3 from boto?

like image 971
Jon Chu Avatar asked Oct 13 '12 23:10

Jon Chu


1 Answers

According to this (https://github.com/jubos/fake-s3/blob/master/test/botocmd.py) from the fakes3 tests, you probably want something like this:

from boto.s3.connection import S3Connection, OrdinaryCallingFormat

s3conn = S3Connection(access_key_id, secret_access_key, is_secure=False, port=4567, host='localhost', calling_format=OrdinaryCallingFormat())
like image 175
garnaat Avatar answered Oct 25 '22 00:10

garnaat