From 5a4565304fa8ebb56645bb20e32c0019facfc1da Mon Sep 17 00:00:00 2001 From: James Saryerwinnie Date: Mon, 29 Jun 2015 10:52:22 -0700 Subject: Add test for ECS connect_to_region() Updated code to be consistent with how other connect_to_region() functions are implemented. Also added a unit test for this. --- tests/unit/ec2containerservice/__init__.py | 0 tests/unit/ec2containerservice/test_connection.py | 33 +++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 tests/unit/ec2containerservice/__init__.py create mode 100755 tests/unit/ec2containerservice/test_connection.py (limited to 'tests') diff --git a/tests/unit/ec2containerservice/__init__.py b/tests/unit/ec2containerservice/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/unit/ec2containerservice/test_connection.py b/tests/unit/ec2containerservice/test_connection.py new file mode 100755 index 00000000..6419e33f --- /dev/null +++ b/tests/unit/ec2containerservice/test_connection.py @@ -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) -- cgit v1.2.1