diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_service_resource.py | 8 | ||||
-rw-r--r-- | tests/test_validator.py | 31 |
2 files changed, 36 insertions, 3 deletions
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"}, ], } } |