diff options
author | fujinhua <fu.jinhua@zte.com.cn> | 2017-09-23 10:11:39 +0800 |
---|---|---|
committer | fujinhua <fu.jinhua@zte.com.cn> | 2017-09-23 10:11:39 +0800 |
commit | 9a24f438662f4f7f0429952b1451d7b60f33b6fb (patch) | |
tree | 2df93fae639d1dca461ae1731f1530d1cd933c6b | |
parent | 038372f59da68f6e85cbb5670e6026447eda97a5 (diff) |
Update UT cases for nsd parse
Change-Id: I4f26ea728a9a099696276404e52c419ea3e6ffa9
Issue-id: VFC-437
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r-- | catalog/packages/ns_package.py | 2 | ||||
-rw-r--r-- | catalog/packages/tests/test_ns.py | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/catalog/packages/ns_package.py b/catalog/packages/ns_package.py index db44b2fc..2ff2b13e 100644 --- a/catalog/packages/ns_package.py +++ b/catalog/packages/ns_package.py @@ -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: diff --git a/catalog/packages/tests/test_ns.py b/catalog/packages/tests/test_ns.py index 25295cb4..34e23149 100644 --- a/catalog/packages/tests/test_ns.py +++ b/catalog/packages/tests/test_ns.py @@ -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."}) |