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

Commit

Permalink
Add test for ECS connect_to_region()
Browse files Browse the repository at this point in the history
Updated code to be consistent with how other connect_to_region()
functions are implemented.

Also added a unit test for this.
  • Loading branch information
jamesls committed Jun 29, 2015
1 parent 2aaa0ca commit 5a45653
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion boto/ec2containerservice/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
# IN THE SOFTWARE.
#
from boto.regioninfo import get_regions
from .layer1 import EC2ContainerServiceConnection


def regions():
Expand All @@ -31,6 +30,7 @@ def regions():
:rtype: list
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
from boto.ec2containerservice.layer1 import EC2ContainerServiceConnection
return get_regions('ec2containerservice',
connection_cls=EC2ContainerServiceConnection)

Expand Down
Empty file.
33 changes: 33 additions & 0 deletions tests/unit/ec2containerservice/test_connection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2015 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# tribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the fol-
# lowing conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
from tests.unit import unittest

import boto.ec2containerservice
from boto.ec2containerservice.layer1 import EC2ContainerServiceConnection


class TestConnectToRegion(unittest.TestCase):

def test_aws_region(self):
ecs = boto.ec2containerservice.connect_to_region('us-east-1')
self.assertIsInstance(ecs, EC2ContainerServiceConnection)

0 comments on commit 5a45653

Please sign in to comment.