diff --git a/dns.env.enc b/dns.env.enc index 9f6529e..48a2e04 100644 Binary files a/dns.env.enc and b/dns.env.enc differ diff --git a/ibm_cloud_networking_services/dns_svcs_v1.py b/ibm_cloud_networking_services/dns_svcs_v1.py index 9d25c64..31c4c67 100644 --- a/ibm_cloud_networking_services/dns_svcs_v1.py +++ b/ibm_cloud_networking_services/dns_svcs_v1.py @@ -14,10 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -# IBM OpenAPI SDK Code Generator Version: 3.32.0-4c6a3129-20210514-210323 +# IBM OpenAPI SDK Code Generator Version: 3.38.0-07189efd-20210827-205025 """ DNS Services API + +API Version: 1.0.0 """ from datetime import datetime @@ -129,7 +131,7 @@ def list_dnszones(self, headers=headers, params=params) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -190,7 +192,7 @@ def create_dnszone(self, headers=headers, data=data) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -237,7 +239,7 @@ def delete_dnszone(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -285,7 +287,7 @@ def get_dnszone(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -347,7 +349,7 @@ def update_dnszone(self, headers=headers, data=data) - response = self.send(request) + response = self.send(request, **kwargs) return response ######################### @@ -411,7 +413,7 @@ def list_resource_records(self, headers=headers, params=params) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -487,7 +489,7 @@ def create_resource_record(self, headers=headers, data=data) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -538,7 +540,7 @@ def delete_resource_record(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -590,7 +592,7 @@ def get_resource_record(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -667,7 +669,7 @@ def update_resource_record(self, headers=headers, data=data) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -715,7 +717,7 @@ def export_resource_records(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -772,7 +774,7 @@ def import_resource_records(self, headers=headers, files=form_data) - response = self.send(request) + response = self.send(request, **kwargs) return response ######################### @@ -836,7 +838,7 @@ def list_permitted_networks(self, headers=headers, params=params) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -900,7 +902,7 @@ def create_permitted_network(self, headers=headers, data=data) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -953,7 +955,7 @@ def delete_permitted_network(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -1006,7 +1008,7 @@ def get_permitted_network(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response ######################### @@ -1058,7 +1060,7 @@ def list_load_balancers(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -1140,7 +1142,7 @@ def create_load_balancer(self, headers=headers, data=data) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -1191,7 +1193,7 @@ def delete_load_balancer(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -1243,7 +1245,7 @@ def get_load_balancer(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -1329,7 +1331,7 @@ def update_load_balancer(self, headers=headers, data=data) - response = self.send(request) + response = self.send(request, **kwargs) return response ######################### @@ -1377,7 +1379,7 @@ def list_pools(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -1464,7 +1466,7 @@ def create_pool(self, headers=headers, data=data) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -1511,7 +1513,7 @@ def delete_pool(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -1559,7 +1561,7 @@ def get_pool(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -1650,7 +1652,7 @@ def update_pool(self, headers=headers, data=data) - response = self.send(request) + response = self.send(request, **kwargs) return response ######################### @@ -1698,7 +1700,7 @@ def list_monitors(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -1811,7 +1813,7 @@ def create_monitor(self, headers=headers, data=data) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -1858,7 +1860,7 @@ def delete_monitor(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -1906,7 +1908,7 @@ def get_monitor(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -2023,7 +2025,7 @@ def update_monitor(self, headers=headers, data=data) - response = self.send(request) + response = self.send(request, **kwargs) return response ######################### @@ -2071,7 +2073,7 @@ def list_custom_resolvers(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -2134,7 +2136,7 @@ def create_custom_resolver(self, headers=headers, data=data) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -2181,7 +2183,7 @@ def delete_custom_resolver(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -2229,7 +2231,7 @@ def get_custom_resolver(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -2293,7 +2295,7 @@ def update_custom_resolver(self, headers=headers, data=data) - response = self.send(request) + response = self.send(request, **kwargs) return response ######################### @@ -2358,7 +2360,7 @@ def add_custom_resolver_location(self, headers=headers, data=data) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -2423,7 +2425,7 @@ def update_custom_resolver_location(self, headers=headers, data=data) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -2474,7 +2476,7 @@ def delete_custom_resolver_location(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response ######################### @@ -2526,7 +2528,7 @@ def list_forwarding_rules(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -2594,7 +2596,7 @@ def create_forwarding_rule(self, headers=headers, data=data) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -2645,7 +2647,7 @@ def delete_forwarding_rule(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -2697,7 +2699,7 @@ def get_forwarding_rule(self, url=url, headers=headers) - response = self.send(request) + response = self.send(request, **kwargs) return response @@ -2766,7 +2768,7 @@ def update_forwarding_rule(self, headers=headers, data=data) - response = self.send(request) + response = self.send(request, **kwargs) return response diff --git a/test/unit/test_dns_svcs_v1.py b/test/unit/test_dns_svcs_v1.py index 94e35d1..b9a9010 100644 --- a/test/unit/test_dns_svcs_v1.py +++ b/test/unit/test_dns_svcs_v1.py @@ -23,13 +23,13 @@ import inspect import io import json +import os import pytest import re import requests import responses import tempfile import urllib -#from github.com/IBM/networking-python-sdk.dns_svcs_v1 import * from ibm_cloud_networking_services.dns_svcs_v1 import * @@ -45,6 +45,32 @@ ############################################################################## # region +class TestNewInstance(): + """ + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = DnsSvcsV1.new_instance( + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, DnsSvcsV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = DnsSvcsV1.new_instance( + ) + class TestListDnszones(): """ Test Class for list_dnszones @@ -54,6 +80,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -163,6 +191,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -274,6 +304,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -371,6 +403,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -477,6 +511,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -592,6 +628,32 @@ def test_update_dnszone_value_error(self): ############################################################################## # region +class TestNewInstance(): + """ + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = DnsSvcsV1.new_instance( + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, DnsSvcsV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = DnsSvcsV1.new_instance( + ) + class TestListResourceRecords(): """ Test Class for list_resource_records @@ -601,6 +663,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -716,6 +780,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -846,6 +912,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -949,6 +1017,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -1061,6 +1131,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -1194,6 +1266,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -1300,6 +1374,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -1411,6 +1487,32 @@ def test_import_resource_records_value_error(self): ############################################################################## # region +class TestNewInstance(): + """ + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = DnsSvcsV1.new_instance( + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, DnsSvcsV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = DnsSvcsV1.new_instance( + ) + class TestListPermittedNetworks(): """ Test Class for list_permitted_networks @@ -1420,6 +1522,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -1535,6 +1639,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -1653,6 +1759,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -1765,6 +1873,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -1878,6 +1988,32 @@ def test_get_permitted_network_value_error(self): ############################################################################## # region +class TestNewInstance(): + """ + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = DnsSvcsV1.new_instance( + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, DnsSvcsV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = DnsSvcsV1.new_instance( + ) + class TestListLoadBalancers(): """ Test Class for list_load_balancers @@ -1887,6 +2023,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -1993,6 +2131,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -2127,6 +2267,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -2230,6 +2372,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -2342,6 +2486,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -2483,6 +2629,32 @@ def test_update_load_balancer_value_error(self): ############################################################################## # region +class TestNewInstance(): + """ + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = DnsSvcsV1.new_instance( + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, DnsSvcsV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = DnsSvcsV1.new_instance( + ) + class TestListPools(): """ Test Class for list_pools @@ -2492,6 +2664,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -2592,6 +2766,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -2728,6 +2904,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -2825,6 +3003,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -2931,6 +3111,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -3074,6 +3256,32 @@ def test_update_pool_value_error(self): ############################################################################## # region +class TestNewInstance(): + """ + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = DnsSvcsV1.new_instance( + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, DnsSvcsV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = DnsSvcsV1.new_instance( + ) + class TestListMonitors(): """ Test Class for list_monitors @@ -3083,6 +3291,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -3183,6 +3393,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -3329,6 +3541,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -3426,6 +3640,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -3532,6 +3748,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -3685,6 +3903,32 @@ def test_update_monitor_value_error(self): ############################################################################## # region +class TestNewInstance(): + """ + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = DnsSvcsV1.new_instance( + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, DnsSvcsV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = DnsSvcsV1.new_instance( + ) + class TestListCustomResolvers(): """ Test Class for list_custom_resolvers @@ -3694,6 +3938,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -3794,6 +4040,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -3910,6 +4158,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -4007,6 +4257,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -4113,6 +4365,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -4231,6 +4485,32 @@ def test_update_custom_resolver_value_error(self): ############################################################################## # region +class TestNewInstance(): + """ + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = DnsSvcsV1.new_instance( + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, DnsSvcsV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = DnsSvcsV1.new_instance( + ) + class TestAddCustomResolverLocation(): """ Test Class for add_custom_resolver_location @@ -4240,6 +4520,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -4354,6 +4636,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -4474,6 +4758,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -4578,6 +4864,32 @@ def test_delete_custom_resolver_location_value_error(self): ############################################################################## # region +class TestNewInstance(): + """ + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = DnsSvcsV1.new_instance( + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, DnsSvcsV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = DnsSvcsV1.new_instance( + ) + class TestListForwardingRules(): """ Test Class for list_forwarding_rules @@ -4587,6 +4899,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -4693,6 +5007,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -4813,6 +5129,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -4916,6 +5234,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -5028,6 +5348,8 @@ def preprocess_url(self, request_url: str): """ Preprocess the request URL to ensure the mock response will be found. """ + request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded + request_url = urllib.parse.quote(request_url, safe=':/') if re.fullmatch('.*/+', request_url) is None: return request_url else: @@ -5152,7 +5474,7 @@ def test_update_forwarding_rule_value_error(self): # Start of Model Tests ############################################################################## # region -class TestLoadBalancerAzPoolsItem(): +class TestModel_LoadBalancerAzPoolsItem(): """ Test Class for LoadBalancerAzPoolsItem """ @@ -5182,7 +5504,7 @@ def test_load_balancer_az_pools_item_serialization(self): load_balancer_az_pools_item_model_json2 = load_balancer_az_pools_item_model.to_dict() assert load_balancer_az_pools_item_model_json2 == load_balancer_az_pools_item_model_json -class TestPoolHealthcheckVsisItem(): +class TestModel_PoolHealthcheckVsisItem(): """ Test Class for PoolHealthcheckVsisItem """ @@ -5214,7 +5536,7 @@ def test_pool_healthcheck_vsis_item_serialization(self): pool_healthcheck_vsis_item_model_json2 = pool_healthcheck_vsis_item_model.to_dict() assert pool_healthcheck_vsis_item_model_json2 == pool_healthcheck_vsis_item_model_json -class TestRecordsImportErrorModelError(): +class TestModel_RecordsImportErrorModelError(): """ Test Class for RecordsImportErrorModelError """ @@ -5244,7 +5566,7 @@ def test_records_import_error_model_error_serialization(self): records_import_error_model_error_model_json2 = records_import_error_model_error_model.to_dict() assert records_import_error_model_error_model_json2 == records_import_error_model_error_model_json -class TestCustomResolver(): +class TestModel_CustomResolver(): """ Test Class for CustomResolver """ @@ -5289,7 +5611,7 @@ def test_custom_resolver_serialization(self): custom_resolver_model_json2 = custom_resolver_model.to_dict() assert custom_resolver_model_json2 == custom_resolver_model_json -class TestCustomResolverList(): +class TestModel_CustomResolverList(): """ Test Class for CustomResolverList """ @@ -5337,7 +5659,7 @@ def test_custom_resolver_list_serialization(self): custom_resolver_list_model_json2 = custom_resolver_list_model.to_dict() assert custom_resolver_list_model_json2 == custom_resolver_list_model_json -class TestDnszone(): +class TestModel_Dnszone(): """ Test Class for Dnszone """ @@ -5373,7 +5695,7 @@ def test_dnszone_serialization(self): dnszone_model_json2 = dnszone_model.to_dict() assert dnszone_model_json2 == dnszone_model_json -class TestFirstHref(): +class TestModel_FirstHref(): """ Test Class for FirstHref """ @@ -5402,7 +5724,7 @@ def test_first_href_serialization(self): first_href_model_json2 = first_href_model.to_dict() assert first_href_model_json2 == first_href_model_json -class TestForwardingRule(): +class TestModel_ForwardingRule(): """ Test Class for ForwardingRule """ @@ -5437,7 +5759,7 @@ def test_forwarding_rule_serialization(self): forwarding_rule_model_json2 = forwarding_rule_model.to_dict() assert forwarding_rule_model_json2 == forwarding_rule_model_json -class TestForwardingRuleList(): +class TestModel_ForwardingRuleList(): """ Test Class for ForwardingRuleList """ @@ -5477,7 +5799,7 @@ def test_forwarding_rule_list_serialization(self): forwarding_rule_list_model_json2 = forwarding_rule_list_model.to_dict() assert forwarding_rule_list_model_json2 == forwarding_rule_list_model_json -class TestHealthcheckHeader(): +class TestModel_HealthcheckHeader(): """ Test Class for HealthcheckHeader """ @@ -5507,7 +5829,7 @@ def test_healthcheck_header_serialization(self): healthcheck_header_model_json2 = healthcheck_header_model.to_dict() assert healthcheck_header_model_json2 == healthcheck_header_model_json -class TestImportResourceRecordsResp(): +class TestModel_ImportResourceRecordsResp(): """ Test Class for ImportResourceRecordsResp """ @@ -5565,7 +5887,7 @@ def test_import_resource_records_resp_serialization(self): import_resource_records_resp_model_json2 = import_resource_records_resp_model.to_dict() assert import_resource_records_resp_model_json2 == import_resource_records_resp_model_json -class TestListDnszones(): +class TestModel_ListDnszones(): """ Test Class for ListDnszones """ @@ -5617,7 +5939,7 @@ def test_list_dnszones_serialization(self): list_dnszones_model_json2 = list_dnszones_model.to_dict() assert list_dnszones_model_json2 == list_dnszones_model_json -class TestListLoadBalancers(): +class TestModel_ListLoadBalancers(): """ Test Class for ListLoadBalancers """ @@ -5677,7 +5999,7 @@ def test_list_load_balancers_serialization(self): list_load_balancers_model_json2 = list_load_balancers_model.to_dict() assert list_load_balancers_model_json2 == list_load_balancers_model_json -class TestListMonitors(): +class TestModel_ListMonitors(): """ Test Class for ListMonitors """ @@ -5742,7 +6064,7 @@ def test_list_monitors_serialization(self): list_monitors_model_json2 = list_monitors_model.to_dict() assert list_monitors_model_json2 == list_monitors_model_json -class TestListPermittedNetworks(): +class TestModel_ListPermittedNetworks(): """ Test Class for ListPermittedNetworks """ @@ -5795,7 +6117,7 @@ def test_list_permitted_networks_serialization(self): list_permitted_networks_model_json2 = list_permitted_networks_model.to_dict() assert list_permitted_networks_model_json2 == list_permitted_networks_model_json -class TestListPools(): +class TestModel_ListPools(): """ Test Class for ListPools """ @@ -5868,7 +6190,7 @@ def test_list_pools_serialization(self): list_pools_model_json2 = list_pools_model.to_dict() assert list_pools_model_json2 == list_pools_model_json -class TestListResourceRecords(): +class TestModel_ListResourceRecords(): """ Test Class for ListResourceRecords """ @@ -5921,7 +6243,7 @@ def test_list_resource_records_serialization(self): list_resource_records_model_json2 = list_resource_records_model.to_dict() assert list_resource_records_model_json2 == list_resource_records_model_json -class TestLoadBalancer(): +class TestModel_LoadBalancer(): """ Test Class for LoadBalancer """ @@ -5966,7 +6288,7 @@ def test_load_balancer_serialization(self): load_balancer_model_json2 = load_balancer_model.to_dict() assert load_balancer_model_json2 == load_balancer_model_json -class TestLocation(): +class TestModel_Location(): """ Test Class for Location """ @@ -5999,7 +6321,7 @@ def test_location_serialization(self): location_model_json2 = location_model.to_dict() assert location_model_json2 == location_model_json -class TestLocationInput(): +class TestModel_LocationInput(): """ Test Class for LocationInput """ @@ -6029,7 +6351,7 @@ def test_location_input_serialization(self): location_input_model_json2 = location_input_model.to_dict() assert location_input_model_json2 == location_input_model_json -class TestMonitor(): +class TestModel_Monitor(): """ Test Class for Monitor """ @@ -6079,7 +6401,7 @@ def test_monitor_serialization(self): monitor_model_json2 = monitor_model.to_dict() assert monitor_model_json2 == monitor_model_json -class TestNextHref(): +class TestModel_NextHref(): """ Test Class for NextHref """ @@ -6108,7 +6430,7 @@ def test_next_href_serialization(self): next_href_model_json2 = next_href_model.to_dict() assert next_href_model_json2 == next_href_model_json -class TestOrigin(): +class TestModel_Origin(): """ Test Class for Origin """ @@ -6142,7 +6464,7 @@ def test_origin_serialization(self): origin_model_json2 = origin_model.to_dict() assert origin_model_json2 == origin_model_json -class TestOriginInput(): +class TestModel_OriginInput(): """ Test Class for OriginInput """ @@ -6174,7 +6496,7 @@ def test_origin_input_serialization(self): origin_input_model_json2 = origin_input_model.to_dict() assert origin_input_model_json2 == origin_input_model_json -class TestPermittedNetwork(): +class TestModel_PermittedNetwork(): """ Test Class for PermittedNetwork """ @@ -6213,7 +6535,7 @@ def test_permitted_network_serialization(self): permitted_network_model_json2 = permitted_network_model.to_dict() assert permitted_network_model_json2 == permitted_network_model_json -class TestPermittedNetworkVpc(): +class TestModel_PermittedNetworkVpc(): """ Test Class for PermittedNetworkVpc """ @@ -6242,7 +6564,7 @@ def test_permitted_network_vpc_serialization(self): permitted_network_vpc_model_json2 = permitted_network_vpc_model.to_dict() assert permitted_network_vpc_model_json2 == permitted_network_vpc_model_json -class TestPool(): +class TestModel_Pool(): """ Test Class for Pool """ @@ -6300,7 +6622,7 @@ def test_pool_serialization(self): pool_model_json2 = pool_model.to_dict() assert pool_model_json2 == pool_model_json -class TestRecordStatsByType(): +class TestModel_RecordStatsByType(): """ Test Class for RecordStatsByType """ @@ -6335,7 +6657,7 @@ def test_record_stats_by_type_serialization(self): record_stats_by_type_model_json2 = record_stats_by_type_model.to_dict() assert record_stats_by_type_model_json2 == record_stats_by_type_model_json -class TestRecordsImportErrorModel(): +class TestModel_RecordsImportErrorModel(): """ Test Class for RecordsImportErrorModel """ @@ -6371,7 +6693,7 @@ def test_records_import_error_model_serialization(self): records_import_error_model_model_json2 = records_import_error_model_model.to_dict() assert records_import_error_model_model_json2 == records_import_error_model_model_json -class TestRecordsImportMessageModel(): +class TestModel_RecordsImportMessageModel(): """ Test Class for RecordsImportMessageModel """ @@ -6401,7 +6723,7 @@ def test_records_import_message_model_serialization(self): records_import_message_model_model_json2 = records_import_message_model_model.to_dict() assert records_import_message_model_model_json2 == records_import_message_model_model_json -class TestResourceRecord(): +class TestModel_ResourceRecord(): """ Test Class for ResourceRecord """ @@ -6438,7 +6760,7 @@ def test_resource_record_serialization(self): resource_record_model_json2 = resource_record_model.to_dict() assert resource_record_model_json2 == resource_record_model_json -class TestResourceRecordInputRdataRdataARecord(): +class TestModel_ResourceRecordInputRdataRdataARecord(): """ Test Class for ResourceRecordInputRdataRdataARecord """ @@ -6467,7 +6789,7 @@ def test_resource_record_input_rdata_rdata_a_record_serialization(self): resource_record_input_rdata_rdata_a_record_model_json2 = resource_record_input_rdata_rdata_a_record_model.to_dict() assert resource_record_input_rdata_rdata_a_record_model_json2 == resource_record_input_rdata_rdata_a_record_model_json -class TestResourceRecordInputRdataRdataAaaaRecord(): +class TestModel_ResourceRecordInputRdataRdataAaaaRecord(): """ Test Class for ResourceRecordInputRdataRdataAaaaRecord """ @@ -6496,7 +6818,7 @@ def test_resource_record_input_rdata_rdata_aaaa_record_serialization(self): resource_record_input_rdata_rdata_aaaa_record_model_json2 = resource_record_input_rdata_rdata_aaaa_record_model.to_dict() assert resource_record_input_rdata_rdata_aaaa_record_model_json2 == resource_record_input_rdata_rdata_aaaa_record_model_json -class TestResourceRecordInputRdataRdataCnameRecord(): +class TestModel_ResourceRecordInputRdataRdataCnameRecord(): """ Test Class for ResourceRecordInputRdataRdataCnameRecord """ @@ -6525,7 +6847,7 @@ def test_resource_record_input_rdata_rdata_cname_record_serialization(self): resource_record_input_rdata_rdata_cname_record_model_json2 = resource_record_input_rdata_rdata_cname_record_model.to_dict() assert resource_record_input_rdata_rdata_cname_record_model_json2 == resource_record_input_rdata_rdata_cname_record_model_json -class TestResourceRecordInputRdataRdataMxRecord(): +class TestModel_ResourceRecordInputRdataRdataMxRecord(): """ Test Class for ResourceRecordInputRdataRdataMxRecord """ @@ -6555,7 +6877,7 @@ def test_resource_record_input_rdata_rdata_mx_record_serialization(self): resource_record_input_rdata_rdata_mx_record_model_json2 = resource_record_input_rdata_rdata_mx_record_model.to_dict() assert resource_record_input_rdata_rdata_mx_record_model_json2 == resource_record_input_rdata_rdata_mx_record_model_json -class TestResourceRecordInputRdataRdataPtrRecord(): +class TestModel_ResourceRecordInputRdataRdataPtrRecord(): """ Test Class for ResourceRecordInputRdataRdataPtrRecord """ @@ -6584,7 +6906,7 @@ def test_resource_record_input_rdata_rdata_ptr_record_serialization(self): resource_record_input_rdata_rdata_ptr_record_model_json2 = resource_record_input_rdata_rdata_ptr_record_model.to_dict() assert resource_record_input_rdata_rdata_ptr_record_model_json2 == resource_record_input_rdata_rdata_ptr_record_model_json -class TestResourceRecordInputRdataRdataSrvRecord(): +class TestModel_ResourceRecordInputRdataRdataSrvRecord(): """ Test Class for ResourceRecordInputRdataRdataSrvRecord """ @@ -6616,7 +6938,7 @@ def test_resource_record_input_rdata_rdata_srv_record_serialization(self): resource_record_input_rdata_rdata_srv_record_model_json2 = resource_record_input_rdata_rdata_srv_record_model.to_dict() assert resource_record_input_rdata_rdata_srv_record_model_json2 == resource_record_input_rdata_rdata_srv_record_model_json -class TestResourceRecordInputRdataRdataTxtRecord(): +class TestModel_ResourceRecordInputRdataRdataTxtRecord(): """ Test Class for ResourceRecordInputRdataRdataTxtRecord """ @@ -6645,7 +6967,7 @@ def test_resource_record_input_rdata_rdata_txt_record_serialization(self): resource_record_input_rdata_rdata_txt_record_model_json2 = resource_record_input_rdata_rdata_txt_record_model.to_dict() assert resource_record_input_rdata_rdata_txt_record_model_json2 == resource_record_input_rdata_rdata_txt_record_model_json -class TestResourceRecordUpdateInputRdataRdataARecord(): +class TestModel_ResourceRecordUpdateInputRdataRdataARecord(): """ Test Class for ResourceRecordUpdateInputRdataRdataARecord """ @@ -6674,7 +6996,7 @@ def test_resource_record_update_input_rdata_rdata_a_record_serialization(self): resource_record_update_input_rdata_rdata_a_record_model_json2 = resource_record_update_input_rdata_rdata_a_record_model.to_dict() assert resource_record_update_input_rdata_rdata_a_record_model_json2 == resource_record_update_input_rdata_rdata_a_record_model_json -class TestResourceRecordUpdateInputRdataRdataAaaaRecord(): +class TestModel_ResourceRecordUpdateInputRdataRdataAaaaRecord(): """ Test Class for ResourceRecordUpdateInputRdataRdataAaaaRecord """ @@ -6703,7 +7025,7 @@ def test_resource_record_update_input_rdata_rdata_aaaa_record_serialization(self resource_record_update_input_rdata_rdata_aaaa_record_model_json2 = resource_record_update_input_rdata_rdata_aaaa_record_model.to_dict() assert resource_record_update_input_rdata_rdata_aaaa_record_model_json2 == resource_record_update_input_rdata_rdata_aaaa_record_model_json -class TestResourceRecordUpdateInputRdataRdataCnameRecord(): +class TestModel_ResourceRecordUpdateInputRdataRdataCnameRecord(): """ Test Class for ResourceRecordUpdateInputRdataRdataCnameRecord """ @@ -6732,7 +7054,7 @@ def test_resource_record_update_input_rdata_rdata_cname_record_serialization(sel resource_record_update_input_rdata_rdata_cname_record_model_json2 = resource_record_update_input_rdata_rdata_cname_record_model.to_dict() assert resource_record_update_input_rdata_rdata_cname_record_model_json2 == resource_record_update_input_rdata_rdata_cname_record_model_json -class TestResourceRecordUpdateInputRdataRdataMxRecord(): +class TestModel_ResourceRecordUpdateInputRdataRdataMxRecord(): """ Test Class for ResourceRecordUpdateInputRdataRdataMxRecord """ @@ -6762,7 +7084,7 @@ def test_resource_record_update_input_rdata_rdata_mx_record_serialization(self): resource_record_update_input_rdata_rdata_mx_record_model_json2 = resource_record_update_input_rdata_rdata_mx_record_model.to_dict() assert resource_record_update_input_rdata_rdata_mx_record_model_json2 == resource_record_update_input_rdata_rdata_mx_record_model_json -class TestResourceRecordUpdateInputRdataRdataPtrRecord(): +class TestModel_ResourceRecordUpdateInputRdataRdataPtrRecord(): """ Test Class for ResourceRecordUpdateInputRdataRdataPtrRecord """ @@ -6791,7 +7113,7 @@ def test_resource_record_update_input_rdata_rdata_ptr_record_serialization(self) resource_record_update_input_rdata_rdata_ptr_record_model_json2 = resource_record_update_input_rdata_rdata_ptr_record_model.to_dict() assert resource_record_update_input_rdata_rdata_ptr_record_model_json2 == resource_record_update_input_rdata_rdata_ptr_record_model_json -class TestResourceRecordUpdateInputRdataRdataSrvRecord(): +class TestModel_ResourceRecordUpdateInputRdataRdataSrvRecord(): """ Test Class for ResourceRecordUpdateInputRdataRdataSrvRecord """ @@ -6823,7 +7145,7 @@ def test_resource_record_update_input_rdata_rdata_srv_record_serialization(self) resource_record_update_input_rdata_rdata_srv_record_model_json2 = resource_record_update_input_rdata_rdata_srv_record_model.to_dict() assert resource_record_update_input_rdata_rdata_srv_record_model_json2 == resource_record_update_input_rdata_rdata_srv_record_model_json -class TestResourceRecordUpdateInputRdataRdataTxtRecord(): +class TestModel_ResourceRecordUpdateInputRdataRdataTxtRecord(): """ Test Class for ResourceRecordUpdateInputRdataRdataTxtRecord """