From 9cc10c174cc0be43df44f27fd9a43bb8675695a9 Mon Sep 17 00:00:00 2001 From: Michal Jagiello Date: Tue, 25 Jan 2022 14:20:34 +0000 Subject: Update properties of the SDC models MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue-ID: INT-2053 Signed-off-by: Michal Jagiello Change-Id: I44ea3ed17948c37698aaa1d2c3a5b83011e0b90a Author: Theo Schönen --- tests/test_service_resource.py | 8 ++++++++ tests/test_validator.py | 31 ++++++++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/test_service_resource.py b/tests/test_service_resource.py index f664676..5a18f54 100644 --- a/tests/test_service_resource.py +++ b/tests/test_service_resource.py @@ -6,6 +6,14 @@ from onap_data_provider.resources.service_resource import ServiceResource SERVICE_RESOURCE_DATA = { "name": "test", + "inputs": [ + {"name": "itest", "type": "string", "value": "itest"}, + {"name": "itest1", "type": "boolean"}, + ], + "properties": [ + {"name": "test", "type": "string", "value": "test"}, + {"name": "test1", "type": "boolean"}, + ], } diff --git a/tests/test_validator.py b/tests/test_validator.py index ad291a9..f0c7273 100644 --- a/tests/test_validator.py +++ b/tests/test_validator.py @@ -82,6 +82,27 @@ def test_validator_vsps(): validator.validate(VersionsEnum.V1_0, input_data) +def test_validator_vnf(): + validator = Validator() + input_data = { + "vnfs": [ + { + "vnf": { + "name": "test", + "vsp": "testvsp", + "inputs": [ + {"name": "itest", "type": "string", "value": "itest"}, + {"name": "itest1", "type": "boolean"}, + {"name": "itest2", "value": True}, + ], + } + } + ] + } + validator.validate(VersionsEnum.V1_0, input_data) + validator.validate(VersionsEnum.V1_1, input_data) + + def test_validator_service(): validator = Validator() input_data = { @@ -91,11 +112,15 @@ def test_validator_service(): "name": "test", "resources": [ {"name": "test", "type": "test"}, - {"name": "test1", "type": "test2"}, + { + "name": "test1", + "type": "test2", + "properties": [{"name": "test0", "value": "test1"}], + }, ], "properties": [ - {"name": "test", "type": "test", "value": "test"}, - {"name": "test1", "type": "test1"}, + {"name": "test", "type": "string", "value": "test"}, + {"name": "test1", "type": "boolean"}, ], } } -- cgit 1.2.3-korg