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)
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)
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)