summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2018-02-12 13:46:51 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2018-02-12 14:09:17 +0800
commitb417bbf9591366ba4803c3b66c40aa07567fd8cc (patch)
tree0242e3832d834b7d55aec7dbea28276ac931283e
parent94810ab189bd9c786bd8de2e1c12868f342707e1 (diff)
Add vfc-catalog parser tests
Change-Id: I55c9de74cdadb5f9cbb58f728905bc8de7cc5519 Issue-ID: VFC-758 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r--catalog/pub/utils/toscaparser/testdata/resource-ZteMmeFixVl-csar.csarbin0 -> 35038 bytes
-rw-r--r--catalog/pub/utils/toscaparser/tests.py32
-rw-r--r--requirements.txt2
3 files changed, 33 insertions, 1 deletions
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
--- /dev/null
+++ b/catalog/pub/utils/toscaparser/testdata/resource-ZteMmeFixVl-csar.csar
Binary files 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