Modify vfc-catalog parser unittests 77/31377/1
authorying.yunlong <ying.yunlong@zte.com.cn>
Mon, 12 Feb 2018 06:26:22 +0000 (14:26 +0800)
committerying.yunlong <ying.yunlong@zte.com.cn>
Mon, 12 Feb 2018 06:26:22 +0000 (14:26 +0800)
Change-Id: Ib3ea7a04dabf366ea171efa2f16ce330d6ff50db
Issue-ID: VFC-758
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
catalog/pub/utils/toscaparser/tests.py
tox.ini

index a37ce68..bbf7e0d 100644 (file)
@@ -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 7facc7c..65fbc96 100644 (file)
--- 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