diff options
author | Daniel G. Taylor <danielgtaylor@gmail.com> | 2014-08-06 10:02:30 -0700 |
---|---|---|
committer | Daniel G. Taylor <danielgtaylor@gmail.com> | 2014-08-06 10:02:30 -0700 |
commit | e74f74ef84c19c703269300b9185f58dd938dc4c (patch) | |
tree | e80edbbdbb7919eedfa8a5632b0aecc0a3cdbae6 /tests | |
parent | 167992c48c2b0fc8552e6bf970049f6b253404bc (diff) | |
parent | 49ca83945903808095bd608461b373cf9d7b8241 (diff) | |
download | boto-e74f74ef84c19c703269300b9185f58dd938dc4c.tar.gz |
Merge branch 'CashStar-develop' into develop
Add ELB idle timeout connection settings. Fixes #2487.
Conflicts:
boto/ec2/elb/attributes.py
tests/unit/ec2/elb/test_attribute.py
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/ec2/elb/test_attribute.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/unit/ec2/elb/test_attribute.py b/tests/unit/ec2/elb/test_attribute.py index 3f00041f..40edecba 100644 --- a/tests/unit/ec2/elb/test_attribute.py +++ b/tests/unit/ec2/elb/test_attribute.py @@ -35,6 +35,21 @@ ATTRIBUTE_GET_FALSE_CZL_RESPONSE = b"""<?xml version="1.0" encoding="UTF-8"?> </DescribeLoadBalancerAttributesResponse> """ +ATTRIBUTE_GET_CS_RESPONSE = b"""<?xml version="1.0" encoding="UTF-8"?> +<DescribeLoadBalancerAttributesResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/"> + <DescribeLoadBalancerAttributesResult> + <LoadBalancerAttributes> + <ConnectionSettings> + <IdleTimeout>30</IdleTimeout> + </ConnectionSettings> + </LoadBalancerAttributes> + </DescribeLoadBalancerAttributesResult> +<ResponseMetadata> + <RequestId>83c88b9d-12b7-11e3-8b82-87b12EXAMPLE</RequestId> +</ResponseMetadata> +</DescribeLoadBalancerAttributesResponse> +""" + ATTRIBUTE_SET_RESPONSE = b"""<?xml version="1.0" encoding="UTF-8"?> <ModifyLoadBalancerAttributesResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/"> <ModifyLoadBalancerAttributesResult/> @@ -63,6 +78,8 @@ ATTRIBUTE_TESTS = [ [('cross_zone_load_balancing.enabled', True)]), (ATTRIBUTE_GET_FALSE_CZL_RESPONSE, [('cross_zone_load_balancing.enabled', False)]), + (ATTRIBUTE_GET_CS_RESPONSE, + [('connecting_settings.idle_timeout', 30)]), ] @@ -173,5 +190,16 @@ class TestLbAttributes(unittest.TestCase): self.assertTrue(lb.disable_cross_zone_load_balancing()) elb.make_request.assert_called_with(*ATTRIBUTE_SET_CZL_FALSE_REQUEST) + def test_lb_get_connection_settings(self): + """Tests checking connectionSettings attribute""" + mock_response, elb, _ = self._setup_mock() + + attrs = [('idle_timeout', 30), ] + mock_response.read.return_value = ATTRIBUTE_GET_CS_RESPONSE + attributes = elb.get_all_lb_attributes('test_elb') + self.assertTrue(isinstance(attributes, LbAttributes)) + for attr, value in attrs: + self.assertEqual(getattr(attributes.connecting_settings, attr), value) + if __name__ == '__main__': unittest.main() |