Update UT cases for nsd parse 81/14781/1
authorfujinhua <fu.jinhua@zte.com.cn>
Sat, 23 Sep 2017 02:11:39 +0000 (10:11 +0800)
committerfujinhua <fu.jinhua@zte.com.cn>
Sat, 23 Sep 2017 02:11:39 +0000 (10:11 +0800)
Change-Id: I4f26ea728a9a099696276404e52c419ea3e6ffa9
Issue-id: VFC-437
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
catalog/packages/ns_package.py
catalog/packages/tests/test_ns.py

index db44b2f..2ff2b13 100644 (file)
@@ -89,7 +89,7 @@ def parse_nsd(csar_id, inputs):
     try:
         ns_pkg = NSPackageModel.objects.filter(nsPackageId=csar_id)
         if not ns_pkg:
-            raise CatalogException("CSAR(%s) does not exist." % csar_id)
+            raise CatalogException("NS CSAR(%s) does not exist." % csar_id)
         csar_path = ns_pkg[0].localFilePath
         ret = {"model": toscaparser.parse_nsd(csar_path, inputs)}
     except CatalogException as e:
index 25295cb..34e2314 100644 (file)
@@ -497,6 +497,7 @@ class TestNsPackage(TestCase):
         resp = self.client.post("/api/catalog/v1/parsernsd", 
             {"csarId": "1", "inputs": []}, format='json')
         self.assertEqual(resp.status_code, status.HTTP_500_INTERNAL_SERVER_ERROR)
+        self.assertEqual(resp.data, {"error": "NS CSAR(1) does not exist."})