From: ying.yunlong Date: Mon, 12 Feb 2018 05:46:51 +0000 (+0800) Subject: Add vfc-catalog parser tests X-Git-Tag: v1.1.0~37 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F71%2F31371%2F2;p=vfc%2Fnfvo%2Fcatalog.git Add vfc-catalog parser tests Change-Id: I55c9de74cdadb5f9cbb58f728905bc8de7cc5519 Issue-ID: VFC-758 Signed-off-by: ying.yunlong --- diff --git a/catalog/pub/utils/toscaparser/testdata/resource-ZteMmeFixVl-csar.csar b/catalog/pub/utils/toscaparser/testdata/resource-ZteMmeFixVl-csar.csar new file mode 100644 index 00000000..7e58ef40 Binary files /dev/null and b/catalog/pub/utils/toscaparser/testdata/resource-ZteMmeFixVl-csar.csar differ diff --git a/catalog/pub/utils/toscaparser/tests.py b/catalog/pub/utils/toscaparser/tests.py new file mode 100644 index 00000000..a37ce686 --- /dev/null +++ b/catalog/pub/utils/toscaparser/tests.py @@ -0,0 +1,32 @@ +# Copyright 2018 ZTE Corporation. +# +# 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. +import os + +from django.test import TestCase + +from catalog.pub.utils.toscaparser import parse_vnfd + + +class TestNsPackage(TestCase): + def setUp(self): + pass + + def tearDown(self): + pass + + def test_nsd_parse(self): + csar_path = os.path.dirname(os.path.abspath(__file__)) + "/testdata/resource-ZteMmeFixVl-csar.csar" + input_parameters = [{"value": "111111", "key": "sdncontroller"}] + vnfd_json = parse_vnfd(csar_path, input_parameters) + print vnfd_json diff --git a/requirements.txt b/requirements.txt index edcc7419..8442b511 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,7 +23,7 @@ unittest_xml_reporting==1.12.0 # for parser cryptography==2.0.3 paramiko==2.0.2 -nfv-toscaparser>=0.5.0 +nfv-toscaparser==0.5.1.dev25 # for auto swagger drf-yasg>=1.2.2