当前位置: 首页>>代码示例>>Python>>正文


Python ELBConnection.make_request方法代码示例

本文整理汇总了Python中boto.ec2.elb.ELBConnection.make_request方法的典型用法代码示例。如果您正苦于以下问题:Python ELBConnection.make_request方法的具体用法?Python ELBConnection.make_request怎么用?Python ELBConnection.make_request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在boto.ec2.elb.ELBConnection的用法示例。


在下文中一共展示了ELBConnection.make_request方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_next_token

# 需要导入模块: from boto.ec2.elb import ELBConnection [as 别名]
# 或者: from boto.ec2.elb.ELBConnection import make_request [as 别名]
 def test_next_token(self):
     elb = ELBConnection(aws_access_key_id="aws_access_key_id", aws_secret_access_key="aws_secret_access_key")
     mock_response = mock.Mock()
     mock_response.read.return_value = DISABLE_RESPONSE
     mock_response.status = 200
     elb.make_request = mock.Mock(return_value=mock_response)
     disabled = elb.disable_availability_zones("mine", ["sample-zone"])
     self.assertEqual(disabled, ["sample-zone"])
开发者ID:bigale,项目名称:boto,代码行数:10,代码来源:test_loadbalancer.py

示例2: test_detach_subnets

# 需要导入模块: from boto.ec2.elb import ELBConnection [as 别名]
# 或者: from boto.ec2.elb.ELBConnection import make_request [as 别名]
    def test_detach_subnets(self):
        elb = ELBConnection(aws_access_key_id="aws_access_key_id", aws_secret_access_key="aws_secret_access_key")
        lb = LoadBalancer(elb, "mylb")

        mock_response = mock.Mock()
        mock_response.read.return_value = DETACH_RESPONSE
        mock_response.status = 200
        elb.make_request = mock.Mock(return_value=mock_response)
        lb.detach_subnets("s-xxx")
开发者ID:bigale,项目名称:boto,代码行数:11,代码来源:test_loadbalancer.py

示例3: _setup_mock

# 需要导入模块: from boto.ec2.elb import ELBConnection [as 别名]
# 或者: from boto.ec2.elb.ELBConnection import make_request [as 别名]
 def _setup_mock(self):
     """Sets up a mock elb request.
     Returns: response, elb connection and LoadBalancer
     """
     mock_response = mock.Mock()
     mock_response.status = 200
     elb = ELBConnection(aws_access_key_id='aws_access_key_id',
                         aws_secret_access_key='aws_secret_access_key')
     elb.make_request = mock.Mock(return_value=mock_response)
     return mock_response, elb, LoadBalancer(elb, 'test_elb')
开发者ID:10sr,项目名称:hue,代码行数:12,代码来源:test_attribute.py

示例4: test_request_with_marker

# 需要导入模块: from boto.ec2.elb import ELBConnection [as 别名]
# 或者: from boto.ec2.elb.ELBConnection import make_request [as 别名]
 def test_request_with_marker(self):
     elb = ELBConnection(aws_access_key_id="aws_access_key_id", aws_secret_access_key="aws_secret_access_key")
     mock_response = mock.Mock()
     mock_response.read.return_value = DESCRIBE_RESPONSE
     mock_response.status = 200
     elb.make_request = mock.Mock(return_value=mock_response)
     load_balancers1 = elb.get_all_load_balancers()
     self.assertEqual("1234", load_balancers1.marker)
     load_balancers2 = elb.get_all_load_balancers(marker=load_balancers1.marker)
     self.assertEqual(len(load_balancers2), 1)
开发者ID:bigale,项目名称:boto,代码行数:12,代码来源:test_loadbalancer.py

示例5: test_other_policy

# 需要导入模块: from boto.ec2.elb import ELBConnection [as 别名]
# 或者: from boto.ec2.elb.ELBConnection import make_request [as 别名]
    def test_other_policy(self):
        elb = ELBConnection(aws_access_key_id="aws_access_key_id", aws_secret_access_key="aws_secret_access_key")
        mock_response = mock.Mock()
        mock_response.read.return_value = DESCRIBE_RESPONSE
        mock_response.status = 200
        elb.make_request = mock.Mock(return_value=mock_response)
        load_balancers = elb.get_all_load_balancers()
        self.assertEqual(len(load_balancers), 1)

        lb = load_balancers[0]
        self.assertEqual(len(lb.policies.other_policies), 2)
        self.assertEqual(
            lb.policies.other_policies[0].policy_name, "AWSConsole-SSLNegotiationPolicy-my-test-loadbalancer"
        )
        self.assertEqual(lb.policies.other_policies[1].policy_name, "EnableProxyProtocol")

        self.assertEqual(len(lb.backends), 1)
        self.assertEqual(len(lb.backends[0].policies), 1)
        self.assertEqual(lb.backends[0].policies[0].policy_name, "EnableProxyProtocol")
        self.assertEqual(lb.backends[0].instance_port, 80)
开发者ID:bigale,项目名称:boto,代码行数:22,代码来源:test_loadbalancer.py


注:本文中的boto.ec2.elb.ELBConnection.make_request方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。