summaryrefslogtreecommitdiffstats
path: root/lcm/ns_pnfs/tests/test_get_pnf.py
diff options
context:
space:
mode:
authorFu Jinhua <fu.jinhua@zte.com.cn>2018-11-03 06:58:23 +0000
committerGerrit Code Review <gerrit@onap.org>2018-11-03 06:58:23 +0000
commit2c3ec81199e28d241ee6c37d3979981fe79fb2bf (patch)
treecfb57c258ea5d0e90553057d2924339954acc3ab /lcm/ns_pnfs/tests/test_get_pnf.py
parent46eaf6719b0ddffe445db6b93e05c7dd4a653de9 (diff)
parent850c3ee912aa4f2a4e65ab9a205e1235dce7071b (diff)
Merge "enhace the ns instance query to support pnfinfo"
Diffstat (limited to 'lcm/ns_pnfs/tests/test_get_pnf.py')
-rw-r--r--lcm/ns_pnfs/tests/test_get_pnf.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/lcm/ns_pnfs/tests/test_get_pnf.py b/lcm/ns_pnfs/tests/test_get_pnf.py
index e5688733..e08ec0fc 100644
--- a/lcm/ns_pnfs/tests/test_get_pnf.py
+++ b/lcm/ns_pnfs/tests/test_get_pnf.py
@@ -97,3 +97,24 @@ class TestGetPnfViews(TestCase):
).save()
response = self.client.get("/api/nslcm/v1/pnfs/%s" % pnfId)
self.assertEqual(status.HTTP_200_OK, response.status_code)
+
+ def test_get_fileter_nsinstance_restapi(self):
+ pnfId = str(uuid.uuid4())
+ nsInstanceId = str(uuid.uuid4())
+ PNFInstModel(pnfId=pnfId,
+ pnfName="Test PNF",
+ pnfdId=str(uuid.uuid4()),
+ pnfdInfoId=str(uuid.uuid4()),
+ pnfProfileId=str(uuid.uuid4()),
+ cpInfo=[{
+ "cpInstanceId": str(uuid.uuid4()),
+ "cpdId": "pnf_ext_cp01",
+ "cpProtocolData": []
+ }],
+ emsId=str(uuid.uuid4()),
+ nsInstances=nsInstanceId
+ ).save()
+ response = self.client.get("/api/nslcm/v1/pnfs?nsInstanceId=%s" % nsInstanceId)
+ self.assertEqual(status.HTTP_200_OK, response.status_code)
+ self.assertEqual(1, len(response.data))
+ self.assertEqual(pnfId, response.data[0]['pnfId'])