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

Commit

Permalink
Merge pull request #35 from sopel/issue-34-fix-missing-ap-southeast-2
Browse files Browse the repository at this point in the history
Fix missing support for ap-southeast-2
  • Loading branch information
sopel committed Apr 15, 2013
2 parents 49d7b6c + 7d4928b commit cd7e864
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion botocross/s3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
'SAEast': 'sa-east-1',
'EU': 'eu-west-1',
'APNortheast': 'ap-northeast-1',
'APSoutheast': 'ap-southeast-1'}
'APSoutheast': 'ap-southeast-1',
'APSoutheast2': 'ap-southeast-2'}

# NOTE: S3 region handling differs in an unfortunate way (likely a legacy issue) and requires special treatment.
def class_iterator(Class):
Expand Down
3 changes: 2 additions & 1 deletion tests/s3/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
import unittest

class S3PackageTest(unittest.TestCase):
num_regions = 8;

def test_region_map(self):
from botocross.s3 import RegionMap

self.assertTrue(7 == len(RegionMap))
self.assertTrue(self.num_regions == len(RegionMap))
9 changes: 5 additions & 4 deletions tests/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
log = logging.getLogger('botocross')

class TestPackage(unittest.TestCase):
num_regions = 8;

def test_configure_logging(self):
from botocross import configure_logging
Expand Down Expand Up @@ -71,10 +72,10 @@ def test_build_filter_params_with_identical_keys(self):

def test_filter_regions(self):
from botocross import filter_regions
import boto.cloudformation
import boto.ec2

log.info("Testing region filter:")
all_regions = boto.cloudformation.regions()
all_regions = boto.ec2.regions()
filtered_regions = filter_regions(all_regions, "us-west-1")
self.assertEquals(1, len(filtered_regions))
filtered_regions = filter_regions(all_regions, "us-west")
Expand All @@ -84,7 +85,7 @@ def test_filter_regions(self):
filtered_regions = filter_regions(all_regions, "west")
self.assertEquals(3, len(filtered_regions))
filtered_regions = filter_regions(all_regions, None)
self.assertEquals(7, len(filtered_regions))
self.assertEquals(self.num_regions, len(filtered_regions))

def test_filter_regions_s3(self):
from botocross import filter_regions_s3
Expand All @@ -101,4 +102,4 @@ def test_filter_regions_s3(self):
filtered_regions = filter_regions_s3(all_regions, "west")
self.assertEquals(3, len(filtered_regions))
filtered_regions = filter_regions_s3(all_regions, None)
self.assertEquals(7, len(filtered_regions))
self.assertEquals(self.num_regions, len(filtered_regions))

0 comments on commit cd7e864

Please sign in to comment.