Example #1
0
 def test_resolver_reginoal(self):
     resolver = EndpointResolverRules(None)
     endpoint_data = EndpointData()
     resolver.endpoint_map = endpoint_data.endpoint_map
     resolver.endpoint_regional = endpoint_data.endpoint_regional
     request = ResolveEndpointRequest("cn-hangzhou", "test", "", "")
     endpoint = resolver.resolve(request)
     self.assertEqual("test.cn-hangzhou.aliyuncs.com", endpoint)
Example #2
0
 def test_resolver_has_endpoint(self):
     resolver = EndpointResolverRules(None)
     request = ResolveEndpointRequest("foo", "test", "", "")
     endpoint_data = EndpointData()
     resolver.endpoint_map = endpoint_data.endpoint_map
     resolver.endpoint_regional = endpoint_data.endpoint_regional
     endpoint = resolver.resolve(request)
     self.assertEqual("bar", endpoint)
Example #3
0
 def test_resolver_network_special_endpoint(self):
     resolver = EndpointResolverRules(None)
     endpoint_data = EndpointData()
     resolver.endpoint_map = endpoint_data.endpoint_map
     resolver.endpoint_regional = endpoint_data.endpoint_regional
     request = ResolveEndpointRequest("foo", "test", "", "")
     request.request_network = "vpc"
     endpoint = resolver.resolve(request)
     self.assertEqual("test-vpc.foo.aliyuncs.com", endpoint)