diff options
author | 2020-05-19 09:52:46 -0700 | |
---|---|---|
committer | 2020-05-19 09:59:16 -0700 | |
commit | d481ad9918d383c82335e52db4a360964194ef5d (patch) | |
tree | f3174fa5bc95e340b908e3c854edf1af2e8119c9 /onap-client/onap_client/sdc/tests/test_vsp.py | |
parent | e4fca937cc6104ff56c52f720d26552febe44bee (diff) |
[VVP] Updates to VVP test-engine
Removing module level variables. These can cause import errors if certain modules are not imported "properly". Removing these lets developers import modules as-needed.
Add support for VNF category. The VNF category is looked up based on the category chosen by the VSP.
Increase test coverage.
Update ovp testsuite based on these changes.
Issue-ID: VVP-418
Signed-off-by: stark, steven <steven.stark@att.com>
Change-Id: I074375b8afae1adff60e0730d6f8a69d01cdd475
Diffstat (limited to 'onap-client/onap_client/sdc/tests/test_vsp.py')
-rw-r--r-- | onap-client/onap_client/sdc/tests/test_vsp.py | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/onap-client/onap_client/sdc/tests/test_vsp.py b/onap-client/onap_client/sdc/tests/test_vsp.py index 4d71a81..f14e16e 100644 --- a/onap-client/onap_client/sdc/tests/test_vsp.py +++ b/onap-client/onap_client/sdc/tests/test_vsp.py @@ -43,12 +43,11 @@ from os.path import dirname, abspath THIS_DIR = dirname(abspath(__file__)) -license_model_client = Client().sdc.license_model -vsp_client = Client().sdc.vsp - @responses.activate def test_vsp_create(): + oc = Client() + LICENSE_MODEL_ID = "license_model_id" LICENSE_MODEL_VERSION_ID = "license_model_version_id" FEATURE_GROUP_ID = "feature_group_id" @@ -59,49 +58,48 @@ def test_vsp_create(): VSP_NAME = "software_product_name" mockup_catalog_item( - license_model_client.catalog_items["GET_LICENSE_MODELS"], + oc.sdc.license_model.catalog_items["GET_LICENSE_MODELS"], override_return_data={ "results": [{"name": LICENSE_MODEL_NAME, "id": LICENSE_MODEL_ID}] }, ) mockup_catalog_item( - license_model_client.catalog_items["GET_LICENSE_MODEL_VERSIONS"], + oc.sdc.license_model.catalog_items["GET_LICENSE_MODEL_VERSIONS"], override_return_data={ "results": [{"name": LICENSE_MODEL_NAME, "id": LICENSE_MODEL_VERSION_ID}] }, ) mockup_catalog_item( - license_model_client.catalog_items["GET_LICENSE_MODEL_VERSION_ATTRIBUTE"], + oc.sdc.license_model.catalog_items["GET_LICENSE_MODEL_VERSION_ATTRIBUTE"], override_return_data={ "results": [{"name": LICENSE_MODEL_NAME, "id": FEATURE_GROUP_ID}] }, override_uri_params={"attribute": "feature-groups"}, ) mockup_catalog_item( - license_model_client.catalog_items["GET_LICENSE_MODEL_VERSION_ATTRIBUTE"], + oc.sdc.license_model.catalog_items["GET_LICENSE_MODEL_VERSION_ATTRIBUTE"], override_return_data={ "results": [{"name": LICENSE_MODEL_NAME, "id": LICENSE_AGREEMENT_ID}] }, override_uri_params={"attribute": "license-agreements"}, ) - mockup_client(license_model_client) mockup_catalog_item( - vsp_client.catalog_items["GET_SOFTWARE_PRODUCTS"], + oc.sdc.vsp.catalog_items["GET_SOFTWARE_PRODUCTS"], override_return_data={"results": []}, ) mockup_catalog_item( - vsp_client.catalog_items["ADD_SOFTWARE_PRODUCT"], + oc.sdc.vsp.catalog_items["ADD_SOFTWARE_PRODUCT"], override_return_data={ "itemId": VSP_MODEL_ID, "version": {"id": VSP_MODEL_VERSION_ID}, }, ) mockup_catalog_item( - vsp_client.catalog_items["GET_SOFTWARE_PRODUCT"], + oc.sdc.vsp.catalog_items["GET_SOFTWARE_PRODUCT"], override_return_data={"name": VSP_NAME}, ) - mockup_client(vsp_client) + mockup_client(oc.sdc.vsp) vsp = sdc.vsp.VSP( "vendor_name", |