ec2-api/ec2api/tests/functional/api/test_regions.py
Andrey Pavlov 3947354c37 move to botocore clients technology
from https://botocore.readthedocs.org/en/latest/client_upgrades.html#client-upgrades

Version 0.104.0 emitted an ImminentRemovalWarning when using the old interface. This warning is now printed to stderr by default. A user can still turn off these warnings via the warnings module.
The develop branch on github will be updated to completely remove the old interface. At this point the client interface will be the only interface available when using the develop branch on github.
A 1.0 alpha version will be released. By default, pip will not pick up any alpha/beta releases.
A 1.0 beta version will be released.
A GA (1.0) version of botocore will be released.

Change-Id: Id6661e3e1e73de018e9b4de7612972654bb27422
2015-04-24 14:18:46 +03:00

44 lines
1.4 KiB
Python

# Copyright 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from ec2api.tests.functional import base
from ec2api.tests.functional import config
CONF = config.CONF
class RegionTest(base.EC2TestCase):
def test_describe_regions(self):
data = self.client.describe_regions()
self.assertNotEmpty(data['Regions'])
region = CONF.aws.aws_region
if not region:
return
regions = [r['RegionName'] for r in data['Regions']]
self.assertIn(region, regions)
def test_describe_zones(self):
data = self.client.describe_availability_zones()
self.assertNotEmpty(data['AvailabilityZones'])
region = CONF.aws.aws_region
if not region:
return
# TODO(andrey-mp): add checking of other fields of returned data