diff --git a/examples/test_resource_manager_v2_examples.py b/examples/test_resource_manager_v2_examples.py new file mode 100644 index 00000000..cca0a9e6 --- /dev/null +++ b/examples/test_resource_manager_v2_examples.py @@ -0,0 +1,251 @@ +# -*- coding: utf-8 -*- +# (C) Copyright IBM Corp. 2021. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Examples for ResourceManagerV2 +""" + +import os +import pytest +from ibm_cloud_sdk_core import ApiException, read_external_sources +from ibm_platform_services.resource_manager_v2 import * + +# +# This file provides an example of how to use the Resource Manager service. +# +# The following configuration properties are assumed to be defined: +# RESOURCE_MANAGER_URL= +# RESOURCE_MANAGER_AUTH_TYPE=iam +# RESOURCE_MANAGER_APIKEY= +# RESOURCE_MANAGER_AUTH_URL= +# +# These configuration properties can be exported as environment variables, or stored +# in a configuration file and then: +# export IBM_CREDENTIALS_FILE= +# +config_file = 'resource_manager.env' + +resource_manager_service = None +delete_resource_manager_service = None + +config = None + +example_quota_id = None +example_user_account_id = None + +resource_group_id = None + +############################################################################## +# Start of Examples for Service: ResourceManagerV2 +############################################################################## +# region +class TestResourceManagerV2Examples(): + """ + Example Test Class for ResourceManagerV2 + """ + + @classmethod + def setup_class(cls): + global resource_manager_service + global delete_resource_manager_service + + if os.path.exists(config_file): + os.environ['IBM_CREDENTIALS_FILE'] = config_file + + # begin-common + + resource_manager_service = ResourceManagerV2.new_instance( + service_name=ResourceManagerV2.DEFAULT_SERVICE_NAME, + ) + + delete_resource_manager_service = ResourceManagerV2.new_instance( + service_name='ALT_RESOURCE_MANAGER', + ) + + # end-common + assert resource_manager_service is not None + assert delete_resource_manager_service is not None + + # Load the configuration + global config + config = read_external_sources(ResourceManagerV2.DEFAULT_SERVICE_NAME) + + global example_quota_id + example_quota_id = config['QUOTA_ID'] + + global example_user_account_id + example_user_account_id = config['USER_ACCOUNT_ID'] + + print('Setup complete.') + + needscredentials = pytest.mark.skipif( + not os.path.exists(config_file), reason="External configuration not available, skipping..." + ) + + @needscredentials + def test_create_resource_group_example(self): + """ + create_resource_group request example + """ + assert example_user_account_id is not None + + try: + # begin-create_resource_group + + res_create_resource_group = resource_manager_service.create_resource_group( + account_id=example_user_account_id, + name='ExampleGroup', + ).get_result() + + print(json.dumps(res_create_resource_group, indent=2)) + + # end-create_resource_group + + global resource_group_id + resource_group_id = res_create_resource_group.get('id') + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_get_resource_group_example(self): + """ + get_resource_group request example + """ + assert resource_group_id is not None + + try: + # begin-get_resource_group + + resource_group = resource_manager_service.get_resource_group( + id=resource_group_id, + ).get_result() + + print(json.dumps(resource_group, indent=2)) + + # end-get_resource_group + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_update_resource_group_example(self): + """ + update_resource_group request example + """ + assert resource_group_id is not None + + try: + # begin-update_resource_group + + resource_group = resource_manager_service.update_resource_group( + id=resource_group_id, + name='RenamedExampleGroup', + state='ACTIVE', + ).get_result() + + print(json.dumps(resource_group, indent=2)) + + # end-update_resource_group + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_list_resource_groups_example(self): + """ + list_resource_groups request example + """ + assert example_user_account_id is not None + + try: + # begin-list_resource_groups + + resource_group_list = resource_manager_service.list_resource_groups( + account_id=example_user_account_id, + include_deleted=True, + ).get_result() + + print(json.dumps(resource_group_list, indent=2)) + + # end-list_resource_groups + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_delete_resource_group_example(self): + """ + delete_resource_group request example + """ + assert resource_group_id is not None + + try: + # begin-delete_resource_group + + response = delete_resource_manager_service.delete_resource_group( + id=resource_group_id, + ).get_result() + + print(json.dumps(response, indent=2)) + + # end-delete_resource_group + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_get_quota_definition_example(self): + """ + get_quota_definition request example + """ + assert example_quota_id is not None + + try: + # begin-get_quota_definition + + quota_definition = resource_manager_service.get_quota_definition( + id=example_quota_id, + ).get_result() + + print(json.dumps(quota_definition, indent=2)) + + # end-get_quota_definition + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_list_quota_definitions_example(self): + """ + list_quota_definitions request example + """ + try: + # begin-list_quota_definitions + + quota_definition_list = resource_manager_service.list_quota_definitions().get_result() + + print(json.dumps(quota_definition_list, indent=2)) + + # end-list_quota_definitions + + except ApiException as e: + pytest.fail(str(e)) + + +# endregion +############################################################################## +# End of Examples for Service: ResourceManagerV2 +############################################################################## diff --git a/ibm_platform_services/resource_manager_v2.py b/ibm_platform_services/resource_manager_v2.py index 903e0c07..6bd5d2e4 100644 --- a/ibm_platform_services/resource_manager_v2.py +++ b/ibm_platform_services/resource_manager_v2.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2020. +# (C) Copyright IBM Corp. 2021. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-d753183b-20201209-163011 +# IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-4883cbcd-20210301-143711 """ Manage lifecycle of your Cloud resource groups using Resource Manager APIs. @@ -80,6 +80,9 @@ def list_resource_groups(self, *, account_id: str = None, date: str = None, + name: str = None, + default: bool = None, + include_deleted: bool = None, **kwargs ) -> DetailedResponse: """ @@ -89,8 +92,14 @@ def list_resource_groups(self, :param str account_id: (optional) The ID of the account that contains the resource groups that you want to get. - :param str date: (optional) The date would be in a format of YYYY-MM which - returns resource groups exclude the deleted ones before this month. + :param str date: (optional) The date in the format of YYYY-MM which returns + resource groups. Deleted resource groups will be excluded before this + month. + :param str name: (optional) The name of the resource group. + :param bool default: (optional) Boolean value to specify whether or not to + list default resource groups. + :param bool include_deleted: (optional) Boolean value to specify whether or + not to list default resource groups. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ResourceGroupList` object @@ -104,7 +113,10 @@ def list_resource_groups(self, params = { 'account_id': account_id, - 'date': date + 'date': date, + 'name': name, + 'default': default, + 'include_deleted': include_deleted } if 'headers' in kwargs: @@ -601,7 +613,7 @@ class ResCreateResourceGroup(): :attr str id: (optional) An alpha-numeric value identifying the resource group. :attr str crn: (optional) The full CRN (cloud resource name) associated with the resource group. For more on this format, see [Cloud Resource - Names](https://cloud.ibm.com/docs/resources?topic=resources-crn). + Names](https://cloud.ibm.com/docs/account?topic=account-crn). """ def __init__(self, @@ -615,7 +627,7 @@ def __init__(self, group. :param str crn: (optional) The full CRN (cloud resource name) associated with the resource group. For more on this format, see [Cloud Resource - Names](https://cloud.ibm.com/docs/resources?topic=resources-crn). + Names](https://cloud.ibm.com/docs/account?topic=account-crn). """ self.id = id self.crn = crn @@ -669,7 +681,7 @@ class ResourceGroup(): :attr str id: (optional) An alpha-numeric value identifying the resource group. :attr str crn: (optional) The full CRN (cloud resource name) associated with the resource group. For more on this format, see [Cloud Resource - Names](https://cloud.ibm.com/docs/resources?topic=resources-crn). + Names](https://cloud.ibm.com/docs/account?topic=account-crn). :attr str account_id: (optional) An alpha-numeric value identifying the account ID. :attr str name: (optional) The human-readable name of the resource group. @@ -714,7 +726,7 @@ def __init__(self, group. :param str crn: (optional) The full CRN (cloud resource name) associated with the resource group. For more on this format, see [Cloud Resource - Names](https://cloud.ibm.com/docs/resources?topic=resources-crn). + Names](https://cloud.ibm.com/docs/account?topic=account-crn). :param str account_id: (optional) An alpha-numeric value identifying the account ID. :param str name: (optional) The human-readable name of the resource group. @@ -900,7 +912,7 @@ class ResourceQuota(): :attr str resource_id: (optional) The human-readable name of the quota. :attr str crn: (optional) The full CRN (cloud resource name) associated with the quota. For more on this format, see - https://cloud.ibm.com/docs/resources?topic=resources-crn#crn. + https://cloud.ibm.com/docs/account?topic=account-crn. :attr float limit: (optional) The limit number of this resource. """ @@ -917,7 +929,7 @@ def __init__(self, :param str resource_id: (optional) The human-readable name of the quota. :param str crn: (optional) The full CRN (cloud resource name) associated with the quota. For more on this format, see - https://cloud.ibm.com/docs/resources?topic=resources-crn#crn. + https://cloud.ibm.com/docs/account?topic=account-crn. :param float limit: (optional) The limit number of this resource. """ self.id = id diff --git a/test/integration/test_resource_manager_v2.py b/test/integration/test_resource_manager_v2.py index 4ccc3a75..b6c19f4f 100644 --- a/test/integration/test_resource_manager_v2.py +++ b/test/integration/test_resource_manager_v2.py @@ -26,17 +26,9 @@ import random from ibm_cloud_sdk_core import * from ibm_platform_services.resource_manager_v2 import * -from dotenv import load_dotenv -# Read config file -configFile = 'resource_manager.env' -configLoaded = None - -if os.path.exists(configFile): - load_dotenv(dotenv_path=configFile) - configLoaded = True -else: - print('External configuration was not found, skipping tests...') +# Location of our config file. +config_file = 'resource_manager.env' class TestResourceManagerV2(unittest.TestCase): """ @@ -45,22 +37,26 @@ class TestResourceManagerV2(unittest.TestCase): @classmethod def setUpClass(cls): - if not configLoaded: - raise unittest.SkipTest( - 'External configuration not available, skipping...') + if os.path.exists(config_file): + os.environ['IBM_CREDENTIALS_FILE'] = config_file + + cls.config = read_external_sources( + ResourceManagerV2.DEFAULT_SERVICE_NAME + ) + assert cls.config is not None - # Construct the first service instance. - cls.service1 = ResourceManagerV2.new_instance(service_name='RMGR1') - assert cls.service1 is not None + # Construct the first service instance. + cls.service = ResourceManagerV2.new_instance(service_name=ResourceManagerV2.DEFAULT_SERVICE_NAME) + assert cls.service is not None - # Construct the second service instance. - cls.service2 = ResourceManagerV2.new_instance(service_name='RMGR2') - assert cls.service2 is not None + # Construct the second service instance. + cls.alt_service = ResourceManagerV2.new_instance(service_name='ALT_RESOURCE_MANAGER') + assert cls.alt_service is not None - # setup default values - cls.test_quota_id = '7ce89f4a-4381-4600-b814-3cd9a4f4bdf4' - cls.test_user_account_id = '60ce10d1d94749bf8dceff12065db1b0' - cls.new_resource_group_id = '' + # setup default values + cls.test_quota_id = cls.config['QUOTA_ID'] + cls.test_user_account_id = cls.config['USER_ACCOUNT_ID'] + cls.new_resource_group_id = '' print('\nSetup complete.') @@ -70,10 +66,10 @@ def tearDownClass(cls): print('\nClean up complete.') def test_00_check_service(self): - assert self.service1 is not None + assert self.service is not None def test_01_list_quota_definitions(self): - response = self.service1.list_quota_definitions() + response = self.service.list_quota_definitions() assert response is not None assert response.get_status_code() == 200 @@ -83,7 +79,7 @@ def test_01_list_quota_definitions(self): assert resources is not None def test_02_get_quota_definition(self): - response = self.service1.get_quota_definition(id=self.test_quota_id) + response = self.service.get_quota_definition(id=self.test_quota_id) assert response is not None assert response.get_status_code() == 200 @@ -91,7 +87,7 @@ def test_02_get_quota_definition(self): assert result is not None def test_03_list_resource_groups_in_an_account(self): - response = self.service1.list_resource_groups( + response = self.service.list_resource_groups( account_id=self.test_user_account_id) assert response is not None assert response.get_status_code() == 200 @@ -114,7 +110,7 @@ def test_03_list_resource_groups_in_an_account(self): assert resources.get('updated_at') is not None def test_04_create_resource_group_in_an_account(self): - response = self.service1.create_resource_group( + response = self.service.create_resource_group( name='TestGroup', account_id=self.test_user_account_id) assert response is not None assert response.get_status_code() == 201 @@ -126,7 +122,7 @@ def test_04_create_resource_group_in_an_account(self): self.__class__.new_resource_group_id = result.get('id') def test_05_get_resource_group_by_id(self): - response = self.service1.get_resource_group( + response = self.service.get_resource_group( id=self.new_resource_group_id) assert response is not None assert response.get_status_code() == 200 @@ -135,7 +131,7 @@ def test_05_get_resource_group_by_id(self): assert result is not None def test_06_update_resource_group_by_id(self): - response = self.service1.update_resource_group( + response = self.service.update_resource_group( id=self.new_resource_group_id, name='TestGroup2', state='ACTIVE') assert response is not None assert response.get_status_code() == 200 @@ -144,7 +140,7 @@ def test_06_update_resource_group_by_id(self): assert result is not None def test_07_delete_resource_group_by_id(self): - response = self.service2.delete_resource_group( + response = self.alt_service.delete_resource_group( id=self.new_resource_group_id) assert response is not None assert response.get_status_code() == 204 diff --git a/test/unit/test_resource_manager_v2.py b/test/unit/test_resource_manager_v2.py index c8906d4f..007d7ea8 100644 --- a/test/unit/test_resource_manager_v2.py +++ b/test/unit/test_resource_manager_v2.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2020. +# (C) Copyright IBM Corp. 2021. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -62,7 +62,7 @@ def test_list_resource_groups_all_params(self): """ # Set up mock url = self.preprocess_url(base_url + '/resource_groups') - mock_response = '{"resources": [{"id": "id", "crn": "crn", "account_id": "account_id", "name": "name", "state": "state", "default": false, "quota_id": "quota_id", "quota_url": "quota_url", "payment_methods_url": "payment_methods_url", "resource_linkages": [{"anyKey": "anyValue"}], "teams_url": "teams_url", "created_at": "2019-01-01T12:00:00", "updated_at": "2019-01-01T12:00:00"}]}' + mock_response = '{"resources": [{"id": "id", "crn": "crn", "account_id": "account_id", "name": "name", "state": "state", "default": false, "quota_id": "quota_id", "quota_url": "quota_url", "payment_methods_url": "payment_methods_url", "resource_linkages": [{"anyKey": "anyValue"}], "teams_url": "teams_url", "created_at": "2019-01-01T12:00:00.000Z", "updated_at": "2019-01-01T12:00:00.000Z"}]}' responses.add(responses.GET, url, body=mock_response, @@ -72,11 +72,17 @@ def test_list_resource_groups_all_params(self): # Set up parameter values account_id = 'testString' date = 'testString' + name = 'testString' + default = True + include_deleted = True # Invoke method response = service.list_resource_groups( account_id=account_id, date=date, + name=name, + default=default, + include_deleted=include_deleted, headers={} ) @@ -88,6 +94,9 @@ def test_list_resource_groups_all_params(self): query_string = urllib.parse.unquote_plus(query_string) assert 'account_id={}'.format(account_id) in query_string assert 'date={}'.format(date) in query_string + assert 'name={}'.format(name) in query_string + assert 'default={}'.format('true' if default else 'false') in query_string + assert 'include_deleted={}'.format('true' if include_deleted else 'false') in query_string @responses.activate @@ -97,7 +106,7 @@ def test_list_resource_groups_required_params(self): """ # Set up mock url = self.preprocess_url(base_url + '/resource_groups') - mock_response = '{"resources": [{"id": "id", "crn": "crn", "account_id": "account_id", "name": "name", "state": "state", "default": false, "quota_id": "quota_id", "quota_url": "quota_url", "payment_methods_url": "payment_methods_url", "resource_linkages": [{"anyKey": "anyValue"}], "teams_url": "teams_url", "created_at": "2019-01-01T12:00:00", "updated_at": "2019-01-01T12:00:00"}]}' + mock_response = '{"resources": [{"id": "id", "crn": "crn", "account_id": "account_id", "name": "name", "state": "state", "default": false, "quota_id": "quota_id", "quota_url": "quota_url", "payment_methods_url": "payment_methods_url", "resource_linkages": [{"anyKey": "anyValue"}], "teams_url": "teams_url", "created_at": "2019-01-01T12:00:00.000Z", "updated_at": "2019-01-01T12:00:00.000Z"}]}' responses.add(responses.GET, url, body=mock_response, @@ -205,7 +214,7 @@ def test_get_resource_group_all_params(self): """ # Set up mock url = self.preprocess_url(base_url + '/resource_groups/testString') - mock_response = '{"id": "id", "crn": "crn", "account_id": "account_id", "name": "name", "state": "state", "default": false, "quota_id": "quota_id", "quota_url": "quota_url", "payment_methods_url": "payment_methods_url", "resource_linkages": [{"anyKey": "anyValue"}], "teams_url": "teams_url", "created_at": "2019-01-01T12:00:00", "updated_at": "2019-01-01T12:00:00"}' + mock_response = '{"id": "id", "crn": "crn", "account_id": "account_id", "name": "name", "state": "state", "default": false, "quota_id": "quota_id", "quota_url": "quota_url", "payment_methods_url": "payment_methods_url", "resource_linkages": [{"anyKey": "anyValue"}], "teams_url": "teams_url", "created_at": "2019-01-01T12:00:00.000Z", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add(responses.GET, url, body=mock_response, @@ -233,7 +242,7 @@ def test_get_resource_group_value_error(self): """ # Set up mock url = self.preprocess_url(base_url + '/resource_groups/testString') - mock_response = '{"id": "id", "crn": "crn", "account_id": "account_id", "name": "name", "state": "state", "default": false, "quota_id": "quota_id", "quota_url": "quota_url", "payment_methods_url": "payment_methods_url", "resource_linkages": [{"anyKey": "anyValue"}], "teams_url": "teams_url", "created_at": "2019-01-01T12:00:00", "updated_at": "2019-01-01T12:00:00"}' + mock_response = '{"id": "id", "crn": "crn", "account_id": "account_id", "name": "name", "state": "state", "default": false, "quota_id": "quota_id", "quota_url": "quota_url", "payment_methods_url": "payment_methods_url", "resource_linkages": [{"anyKey": "anyValue"}], "teams_url": "teams_url", "created_at": "2019-01-01T12:00:00.000Z", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add(responses.GET, url, body=mock_response, @@ -275,7 +284,7 @@ def test_update_resource_group_all_params(self): """ # Set up mock url = self.preprocess_url(base_url + '/resource_groups/testString') - mock_response = '{"id": "id", "crn": "crn", "account_id": "account_id", "name": "name", "state": "state", "default": false, "quota_id": "quota_id", "quota_url": "quota_url", "payment_methods_url": "payment_methods_url", "resource_linkages": [{"anyKey": "anyValue"}], "teams_url": "teams_url", "created_at": "2019-01-01T12:00:00", "updated_at": "2019-01-01T12:00:00"}' + mock_response = '{"id": "id", "crn": "crn", "account_id": "account_id", "name": "name", "state": "state", "default": false, "quota_id": "quota_id", "quota_url": "quota_url", "payment_methods_url": "payment_methods_url", "resource_linkages": [{"anyKey": "anyValue"}], "teams_url": "teams_url", "created_at": "2019-01-01T12:00:00.000Z", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add(responses.PATCH, url, body=mock_response, @@ -311,7 +320,7 @@ def test_update_resource_group_required_params(self): """ # Set up mock url = self.preprocess_url(base_url + '/resource_groups/testString') - mock_response = '{"id": "id", "crn": "crn", "account_id": "account_id", "name": "name", "state": "state", "default": false, "quota_id": "quota_id", "quota_url": "quota_url", "payment_methods_url": "payment_methods_url", "resource_linkages": [{"anyKey": "anyValue"}], "teams_url": "teams_url", "created_at": "2019-01-01T12:00:00", "updated_at": "2019-01-01T12:00:00"}' + mock_response = '{"id": "id", "crn": "crn", "account_id": "account_id", "name": "name", "state": "state", "default": false, "quota_id": "quota_id", "quota_url": "quota_url", "payment_methods_url": "payment_methods_url", "resource_linkages": [{"anyKey": "anyValue"}], "teams_url": "teams_url", "created_at": "2019-01-01T12:00:00.000Z", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add(responses.PATCH, url, body=mock_response, @@ -339,7 +348,7 @@ def test_update_resource_group_value_error(self): """ # Set up mock url = self.preprocess_url(base_url + '/resource_groups/testString') - mock_response = '{"id": "id", "crn": "crn", "account_id": "account_id", "name": "name", "state": "state", "default": false, "quota_id": "quota_id", "quota_url": "quota_url", "payment_methods_url": "payment_methods_url", "resource_linkages": [{"anyKey": "anyValue"}], "teams_url": "teams_url", "created_at": "2019-01-01T12:00:00", "updated_at": "2019-01-01T12:00:00"}' + mock_response = '{"id": "id", "crn": "crn", "account_id": "account_id", "name": "name", "state": "state", "default": false, "quota_id": "quota_id", "quota_url": "quota_url", "payment_methods_url": "payment_methods_url", "resource_linkages": [{"anyKey": "anyValue"}], "teams_url": "teams_url", "created_at": "2019-01-01T12:00:00.000Z", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add(responses.PATCH, url, body=mock_response, @@ -455,7 +464,7 @@ def test_list_quota_definitions_all_params(self): """ # Set up mock url = self.preprocess_url(base_url + '/quota_definitions') - mock_response = '{"resources": [{"id": "id", "name": "name", "type": "type", "number_of_apps": 14, "number_of_service_instances": 27, "default_number_of_instances_per_lite_plan": 41, "instances_per_app": 17, "instance_memory": "instance_memory", "total_app_memory": "total_app_memory", "vsi_limit": 9, "resource_quotas": [{"_id": "id", "resource_id": "resource_id", "crn": "crn", "limit": 5}], "created_at": "2019-01-01T12:00:00", "updated_at": "2019-01-01T12:00:00"}]}' + mock_response = '{"resources": [{"id": "id", "name": "name", "type": "type", "number_of_apps": 14, "number_of_service_instances": 27, "default_number_of_instances_per_lite_plan": 41, "instances_per_app": 17, "instance_memory": "instance_memory", "total_app_memory": "total_app_memory", "vsi_limit": 9, "resource_quotas": [{"_id": "id", "resource_id": "resource_id", "crn": "crn", "limit": 5}], "created_at": "2019-01-01T12:00:00.000Z", "updated_at": "2019-01-01T12:00:00.000Z"}]}' responses.add(responses.GET, url, body=mock_response, @@ -492,7 +501,7 @@ def test_get_quota_definition_all_params(self): """ # Set up mock url = self.preprocess_url(base_url + '/quota_definitions/testString') - mock_response = '{"id": "id", "name": "name", "type": "type", "number_of_apps": 14, "number_of_service_instances": 27, "default_number_of_instances_per_lite_plan": 41, "instances_per_app": 17, "instance_memory": "instance_memory", "total_app_memory": "total_app_memory", "vsi_limit": 9, "resource_quotas": [{"_id": "id", "resource_id": "resource_id", "crn": "crn", "limit": 5}], "created_at": "2019-01-01T12:00:00", "updated_at": "2019-01-01T12:00:00"}' + mock_response = '{"id": "id", "name": "name", "type": "type", "number_of_apps": 14, "number_of_service_instances": 27, "default_number_of_instances_per_lite_plan": 41, "instances_per_app": 17, "instance_memory": "instance_memory", "total_app_memory": "total_app_memory", "vsi_limit": 9, "resource_quotas": [{"_id": "id", "resource_id": "resource_id", "crn": "crn", "limit": 5}], "created_at": "2019-01-01T12:00:00.000Z", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add(responses.GET, url, body=mock_response, @@ -520,7 +529,7 @@ def test_get_quota_definition_value_error(self): """ # Set up mock url = self.preprocess_url(base_url + '/quota_definitions/testString') - mock_response = '{"id": "id", "name": "name", "type": "type", "number_of_apps": 14, "number_of_service_instances": 27, "default_number_of_instances_per_lite_plan": 41, "instances_per_app": 17, "instance_memory": "instance_memory", "total_app_memory": "total_app_memory", "vsi_limit": 9, "resource_quotas": [{"_id": "id", "resource_id": "resource_id", "crn": "crn", "limit": 5}], "created_at": "2019-01-01T12:00:00", "updated_at": "2019-01-01T12:00:00"}' + mock_response = '{"id": "id", "name": "name", "type": "type", "number_of_apps": 14, "number_of_service_instances": 27, "default_number_of_instances_per_lite_plan": 41, "instances_per_app": 17, "instance_memory": "instance_memory", "total_app_memory": "total_app_memory", "vsi_limit": 9, "resource_quotas": [{"_id": "id", "resource_id": "resource_id", "crn": "crn", "limit": 5}], "created_at": "2019-01-01T12:00:00.000Z", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add(responses.GET, url, body=mock_response,