diff options
author | James Saryerwinnie <js@jamesls.com> | 2016-07-08 12:22:22 -0700 |
---|---|---|
committer | James Saryerwinnie <js@jamesls.com> | 2016-07-08 12:22:22 -0700 |
commit | c969b1315c05ac23dea7ea6920e07c3c41c81819 (patch) | |
tree | 48e6e15c2854d8554eb095f19a33c348c39530dc /tests | |
parent | 250d891c06836c2af13cb58cdf980c5387d72ab9 (diff) | |
download | boto-c969b1315c05ac23dea7ea6920e07c3c41c81819.tar.gz |
Mock https connection in ecs test
Makes this consistent with the EC2 unit tests.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/unit/ec2containerservice/test_connection.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/unit/ec2containerservice/test_connection.py b/tests/unit/ec2containerservice/test_connection.py index 6419e33f..1e544840 100755 --- a/tests/unit/ec2containerservice/test_connection.py +++ b/tests/unit/ec2containerservice/test_connection.py @@ -20,6 +20,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. # +import httplib +from mock import Mock from tests.unit import unittest import boto.ec2containerservice @@ -28,6 +30,15 @@ from boto.ec2containerservice.layer1 import EC2ContainerServiceConnection class TestConnectToRegion(unittest.TestCase): + def setUp(self): + self.https_connection = Mock(spec=httplib.HTTPSConnection) + self.https_connection_factory = ( + Mock(return_value=self.https_connection), ()) + def test_aws_region(self): - ecs = boto.ec2containerservice.connect_to_region('us-east-1') + ecs = boto.ec2containerservice.connect_to_region('us-east-1', + https_connection_factory=self.https_connection_factory, + aws_access_key_id='aws_access_key_id', + aws_secret_access_key='aws_secret_access_key' + ) self.assertIsInstance(ecs, EC2ContainerServiceConnection) |