Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3254 from HarryRybacki/add_EUCentral1_to_s3
Browse files Browse the repository at this point in the history
Add EUCentral1 (Frankfurt) to S3 Location
  • Loading branch information
jamesls committed Aug 19, 2015
2 parents fc2aa54 + 29de197 commit 7789bd0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion boto/s3/connection.py
Expand Up @@ -138,7 +138,8 @@ def build_url_base(self, connection, protocol, server, bucket, key=''):
class Location(object):

DEFAULT = '' # US Classic Region
EU = 'EU'
EU = 'EU' # Ireland
EUCentral1 = 'eu-central-1' # Frankfurt
USWest = 'us-west-1'
USWest2 = 'us-west-2'
SAEast = 'sa-east-1'
Expand Down
1 change: 1 addition & 0 deletions docs/source/s3_tut.rst
Expand Up @@ -81,6 +81,7 @@ boto.s3.connection module, like this::
APSoutheast2
DEFAULT
EU
EUCentral1
SAEast
USWest
USWest2
Expand Down
5 changes: 5 additions & 0 deletions tests/integration/s3/test_connect_to_region.py
Expand Up @@ -57,6 +57,11 @@ def testSuccessWithDefaultUSEast1(self):
self.assertEquals('s3.amazonaws.com', connection.host)
self.assertIsInstance(connection, S3Connection)

def testSuccessWithDefaultEUCentral1(self):
connection = connect_to_region('eu-central-1')
self.assertEquals('s3.eu-central-1.amazonaws.com', connection.host)
self.assertIsInstance(connection, S3Connection)

def testDefaultWithInvalidHost(self):
connect_args = dict({'host':''})
connection = connect_to_region('us-west-2', **connect_args)
Expand Down
10 changes: 9 additions & 1 deletion tests/unit/s3/test_bucket.py
Expand Up @@ -6,7 +6,7 @@
from tests.unit import AWSMockServiceTestCase

from boto.exception import BotoClientError
from boto.s3.connection import S3Connection
from boto.s3.connection import Location, S3Connection
from boto.s3.bucket import Bucket
from boto.s3.deletemarker import DeleteMarker
from boto.s3.key import Key
Expand All @@ -25,6 +25,14 @@ def test_bucket_create_bucket(self):
bucket = self.service_connection.create_bucket('mybucket_create')
self.assertEqual(bucket.name, 'mybucket_create')

def test_bucket_create_eu_central_1_location(self):
self.set_http_response(status_code=200)
bucket = self.service_connection.create_bucket(
'eu_central_1_bucket',
location=Location.EUCentral1
)
self.assertEqual(bucket.name, 'eu_central_1_bucket')

def test_bucket_constructor(self):
self.set_http_response(status_code=200)
bucket = Bucket(self.service_connection, 'mybucket_constructor')
Expand Down

0 comments on commit 7789bd0

Please sign in to comment.