From e0b0e3530f0868824cee91dbf330d58290c5a4f8 Mon Sep 17 00:00:00 2001 From: "ying.yunlong" Date: Mon, 12 Feb 2018 14:26:22 +0800 Subject: Modify vfc-catalog parser unittests Change-Id: Ib3ea7a04dabf366ea171efa2f16ce330d6ff50db Issue-ID: VFC-758 Signed-off-by: ying.yunlong --- catalog/pub/utils/toscaparser/tests.py | 6 ++++-- tox.ini | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/catalog/pub/utils/toscaparser/tests.py b/catalog/pub/utils/toscaparser/tests.py index a37ce686..bbf7e0da 100644 --- a/catalog/pub/utils/toscaparser/tests.py +++ b/catalog/pub/utils/toscaparser/tests.py @@ -11,6 +11,7 @@ # 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 json import os from django.test import TestCase @@ -18,7 +19,7 @@ from django.test import TestCase from catalog.pub.utils.toscaparser import parse_vnfd -class TestNsPackage(TestCase): +class TestToscaparser(TestCase): def setUp(self): pass @@ -29,4 +30,5 @@ class TestNsPackage(TestCase): 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 + metadata = json.loads(vnfd_json).get("metadata") + self.assertEqual("ZTE-MME-FIX-VL", metadata.get("name", "")) diff --git a/tox.ini b/tox.ini index 7facc7ce..65fbc960 100644 --- a/tox.ini +++ b/tox.ini @@ -22,4 +22,4 @@ commands = {[testenv]commands} [testenv:cov] -commands = coverage html --omit="*test_*,*__init__.py,*site-packages*" -d htmlcov +commands = coverage html --omit="*test*,*__init__.py,*site-packages*" -d htmlcov -- cgit 1.2.3-korg