From 55f39265dd6b07dadeb269546645bc0ed6f7412b Mon Sep 17 00:00:00 2001 From: Jesse Szwedko Date: Wed, 18 Jan 2017 19:55:22 -0800 Subject: [PATCH] Upgrade to boto 2.45 (#803) Adds support for additional regions: * ca-central-1 * eu-west-2 Signed-off-by: Andrew Harris --- .travis.yml | 4 ++-- moto/ec2/models.py | 2 ++ tests/test_ec2/test_availability_zones_and_regions.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 117370bc9..35506f2dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,11 @@ python: - 2.7 env: matrix: - - BOTO_VERSION=2.43.0 + - BOTO_VERSION=2.45.0 matrix: include: - python: "3.3" - env: BOTO_VERSION=2.43.0 + env: BOTO_VERSION=2.45.0 install: - travis_retry pip install boto==$BOTO_VERSION - travis_retry pip install boto3 diff --git a/moto/ec2/models.py b/moto/ec2/models.py index 5d220a0e2..25befabc0 100755 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -1092,9 +1092,11 @@ class RegionsAndZonesBackend(object): Region("ap-south-1", "ec2.ap-south-1.amazonaws.com"), Region("ap-southeast-1", "ec2.ap-southeast-1.amazonaws.com"), Region("ap-southeast-2", "ec2.ap-southeast-2.amazonaws.com"), + Region("ca-central-1", "ec2.ca-central-1.amazonaws.com.cn"), Region("cn-north-1", "ec2.cn-north-1.amazonaws.com.cn"), Region("eu-central-1", "ec2.eu-central-1.amazonaws.com"), Region("eu-west-1", "ec2.eu-west-1.amazonaws.com"), + Region("eu-west-2", "ec2.eu-west-2.amazonaws.com"), Region("sa-east-1", "ec2.sa-east-1.amazonaws.com"), Region("us-east-1", "ec2.us-east-1.amazonaws.com"), Region("us-east-2", "ec2.us-east-2.amazonaws.com"), diff --git a/tests/test_ec2/test_availability_zones_and_regions.py b/tests/test_ec2/test_availability_zones_and_regions.py index 2ab8b9994..88453e10b 100644 --- a/tests/test_ec2/test_availability_zones_and_regions.py +++ b/tests/test_ec2/test_availability_zones_and_regions.py @@ -11,7 +11,7 @@ from moto import mock_ec2 def test_describe_regions(): conn = boto.connect_ec2('the_key', 'the_secret') regions = conn.get_all_regions() - regions.should.have.length_of(14) + regions.should.have.length_of(16) for region in regions: region.endpoint.should.contain(region.name) @@ -32,7 +32,7 @@ def test_availability_zones(): def test_boto3_describe_regions(): ec2 = boto3.client('ec2', 'us-east-1') resp = ec2.describe_regions() - resp['Regions'].should.have.length_of(14) + resp['Regions'].should.have.length_of(16) for rec in resp['Regions']: rec['Endpoint'].should.contain(rec['RegionName'])