aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2018-02-12 14:26:22 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2018-02-12 14:26:22 +0800
commite0b0e3530f0868824cee91dbf330d58290c5a4f8 (patch)
tree2ce7b2e185f1a60b22e5648b792a9449be2b3654
parentb417bbf9591366ba4803c3b66c40aa07567fd8cc (diff)
Modify vfc-catalog parser unittests
Change-Id: Ib3ea7a04dabf366ea171efa2f16ce330d6ff50db Issue-ID: VFC-758 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r--catalog/pub/utils/toscaparser/tests.py6
-rw-r--r--tox.ini2
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