Add vfc-catalog parser tests 71/31371/2
authorying.yunlong <ying.yunlong@zte.com.cn>
Mon, 12 Feb 2018 05:46:51 +0000 (13:46 +0800)
committerying.yunlong <ying.yunlong@zte.com.cn>
Mon, 12 Feb 2018 06:09:17 +0000 (14:09 +0800)
Change-Id: I55c9de74cdadb5f9cbb58f728905bc8de7cc5519
Issue-ID: VFC-758
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
catalog/pub/utils/toscaparser/testdata/resource-ZteMmeFixVl-csar.csar [new file with mode: 0644]
catalog/pub/utils/toscaparser/tests.py [new file with mode: 0644]
requirements.txt

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 (file)
index 0000000..7e58ef4
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 (file)
index 0000000..a37ce68
--- /dev/null
@@ -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
index edcc741..8442b51 100644 (file)
@@ -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