diff options
author | 2020-07-21 15:14:27 -0700 | |
---|---|---|
committer | 2020-07-21 15:15:34 -0700 | |
commit | 9df81b14e7203d6c3911f5f36881cb5170afdccc (patch) | |
tree | 2a9b5e913e83d0f21b374f068c53df266d3dec56 /onap-client/onap_client/so/tests | |
parent | b3e7a9fbcbf52ac095ca424f3f17610bf1e8df88 (diff) |
[VVP] onap-client refactoring
removing create hook from _init_ for resources
removing _init_ for non-abstract resources
refactor validation logic
enhancing error catch for resource failure
adding _on_failure hook
Issue-ID: VVP-441
Signed-off-by: stark, steven <steven.stark@att.com>
Change-Id: Ia627fc7fd35fe6e112d6f89399701c70b5888077
Diffstat (limited to 'onap-client/onap_client/so/tests')
3 files changed, 35 insertions, 32 deletions
diff --git a/onap-client/onap_client/so/tests/test_module_instance.py b/onap-client/onap_client/so/tests/test_module_instance.py index 297fdea..e102702 100644 --- a/onap-client/onap_client/so/tests/test_module_instance.py +++ b/onap-client/onap_client/so/tests/test_module_instance.py @@ -212,16 +212,17 @@ def test_module_instance(): ) mi = ModuleInstance( - MODULE_INSTANCE_NAME, - VNF_INSTANCE_NAME, - SERVICE_INSTANCE_NAME, - "cs0008", - HEAT_TEMPLATE_NAME, - "{}/base_preload.json".format(THIS_DIR), - TENANT_NAME, - CLOUD_OWNER, - CLOUD_REGION, - "GR_API" + module_instance_name=MODULE_INSTANCE_NAME, + vnf_instance_name=VNF_INSTANCE_NAME, + service_instance_name=SERVICE_INSTANCE_NAME, + requestor_id="cs0008", + heat_template_name=HEAT_TEMPLATE_NAME, + preload_path="{}/base_preload.json".format(THIS_DIR), + tenant_name=TENANT_NAME, + cloud_owner=CLOUD_OWNER, + cloud_region=CLOUD_REGION, + api_type="GR_API" ) + mi.create() assert mi.module_instance_name == MODULE_INSTANCE_NAME diff --git a/onap-client/onap_client/so/tests/test_service_instance.py b/onap-client/onap_client/so/tests/test_service_instance.py index e0afccc..b215fbf 100644 --- a/onap-client/onap_client/so/tests/test_service_instance.py +++ b/onap-client/onap_client/so/tests/test_service_instance.py @@ -119,18 +119,19 @@ def test_service_instance(): ) si = ServiceInstance( - SERVICE_INSTANCE_NAME, - "cs0008", - SERVICE_MODEL_NAME, - "1.0", - TENANT_NAME, - CLOUD_OWNER, - CLOUD_REGION, - "GR_API", - "ONAPSERVICE", - "ONAPCUSTOMER", - "ONAPPROJECT", - OWNING_ENTITY_NAME + service_instance_name=SERVICE_INSTANCE_NAME, + requestor_id="cs0008", + model_name=SERVICE_MODEL_NAME, + model_version="1.0", + tenant_name=TENANT_NAME, + cloud_owner=CLOUD_OWNER, + cloud_region=CLOUD_REGION, + api_type="GR_API", + service_type="ONAPSERVICE", + customer_name="ONAPCUSTOMER", + project_name="ONAPPROJECT", + owning_entity_name=OWNING_ENTITY_NAME ) + si.create() assert si.service_instance_name == SERVICE_INSTANCE_NAME diff --git a/onap-client/onap_client/so/tests/test_vnf_instance.py b/onap-client/onap_client/so/tests/test_vnf_instance.py index 3805da8..cecdb39 100644 --- a/onap-client/onap_client/so/tests/test_vnf_instance.py +++ b/onap-client/onap_client/so/tests/test_vnf_instance.py @@ -159,16 +159,17 @@ def test_vnf_instance(): ) vnfi = VNFInstance( - VNF_INSTANCE_NAME, - SERVICE_INSTANCE_NAME, - "cs0008", - VNF_MODEL_NAME, - TENANT_NAME, - CLOUD_OWNER, - CLOUD_REGION, - "GR_API", - "platform", - "lob" + vnf_instance_name=VNF_INSTANCE_NAME, + service_instance_name=SERVICE_INSTANCE_NAME, + requestor_id="cs0008", + model_name=VNF_MODEL_NAME, + tenant_name=TENANT_NAME, + cloud_owner=CLOUD_OWNER, + cloud_region=CLOUD_REGION, + api_type="GR_API", + platform="platform", + line_of_business="lob" ) + vnfi.create() assert vnfi.vnf_instance_name == VNF_INSTANCE_NAME |