Add inst ns result 53/91153/2
authorhewei-cmss <hewei@cmss.chinamobile.com>
Wed, 10 Jul 2019 11:42:23 +0000 (19:42 +0800)
committerhewei-cmss <hewei@cmss.chinamobile.com>
Wed, 10 Jul 2019 12:01:36 +0000 (20:01 +0800)
Issue-ID: VFC-1444

Signed-off-by: hewei-cmss <hewei@cmss.chinamobile.com>
Change-Id: I380d65e5a768785b76dea318149759287826f63f

lcm/ns/tests/test_sol_ns_instantiate_api.py
lcm/ns/views/sol/instantiate_ns_views.py

index c094a4f..f13b7c4 100644 (file)
@@ -64,7 +64,7 @@ class TestInstantiateNsApi(TestCase):
 
     @mock.patch.object(InstantNSService, 'do_biz')
     def test_ns_instantiate_normal(self, mock_do_biz):
-        mock_do_biz.return_value = {'occ_id': "1"}
+        mock_do_biz.return_value = {'occ_id': "1", 'data': {}}
         response = self.client.post(self.url % self.nsInstanceId, data=self.req_data, format='json')
         self.assertEqual(status.HTTP_202_ACCEPTED, response.status_code)
 
index ae8c51d..08066be 100644 (file)
@@ -60,7 +60,7 @@ class InstantiateNsView(APIView):
         nsLcmOpOccId = ack.get('occ_id')
         if not nsLcmOpOccId:
             return Response(data=ack['data'], status=ack['status'])
-        response = Response(data={}, status=status.HTTP_202_ACCEPTED)
+        response = Response(data=ack['data'], status=status.HTTP_202_ACCEPTED)
         logger.debug("Location: %s" % ack['occ_id'])
         response["Location"] = NS_OCC_BASE_URI % nsLcmOpOccId
         logger.debug("Leave InstantiateNsView::post::ack=%s", ack)