SOL003 API Align
[vfc/nfvo/lcm.git] / lcm / ns_vls / tests / tests.py
similarity index 93%
rename from lcm/ns/tests/vls/tests.py
rename to lcm/ns_vls/tests/tests.py
index 2891068..ef670a3 100644 (file)
@@ -19,10 +19,10 @@ import mock
 from django.test import TestCase, Client
 from rest_framework import status
 
-from lcm.ns.tests.vnfs.tests import vim_info
 from lcm.pub.database.models import VLInstModel, NSInstModel, VNFFGInstModel
 from lcm.pub.nfvi.vim import vimadaptor
 from lcm.pub.utils import restcall
+from lcm.ns_vnfs.tests.tests import vim_info
 
 
 class TestVlViews(TestCase):
@@ -39,8 +39,8 @@ class TestVlViews(TestCase):
                       "end_ip": "190.168.100.100", "gateway_ip": "190.168.100.1", "start_ip": "190.168.100.2",
                       "cidr": "190.168.100.0/24", "mtu": 1500, "network_name": "sub_mnet", "ip_version": 4}
         self.context = {
-            "vls": [{"vl_id": self.vl_id_1, "description": "", "properties": properties, "route_external": False},
-                    {"vl_id": self.vl_id_2, "description": "", "properties": properties, "route_external": False}],
+            "ns_vls": [{"vl_id": self.vl_id_1, "description": "", "properties": properties, "route_external": False},
+                       {"vl_id": self.vl_id_2, "description": "", "properties": properties, "route_external": False}],
             "vnffgs": [{"vnffg_id": self.vnffg_id, "description": "",
                         "properties": {"vendor": "zte", "version": "1.1.2", "number_of_endpoints": 7,
                                        "dependent_virtual_link": [self.vl_id_2, self.vl_id_1],
@@ -87,7 +87,7 @@ class TestVlViews(TestCase):
             "nsInstanceId": self.ns_inst_id,
             "context": json.JSONEncoder().encode(self.context),
             "vlIndex": vl_id}
-        response = self.client.post("/api/nslcm/v1/ns/vls", data=req_data)
+        response = self.client.post("/api/nslcm/v1/ns/ns_vls", data=req_data)
         self.assertEqual(status.HTTP_201_CREATED, response.status_code)
         self.assertEqual(0, response.data["result"], response.data)
 
@@ -103,7 +103,7 @@ class TestVlViews(TestCase):
         mock_uuid4.return_value = '999'
         mock_req_by_rest.return_value = [0, json.JSONEncoder().encode(vim_info), '200']
         mock_create_network.return_value = [1, (1)]
-        response = self.client.post("/api/nslcm/v1/ns/vls", data=req_data)
+        response = self.client.post("/api/nslcm/v1/ns/ns_vls", data=req_data)
         retinfo = {"detail": "vl instantiation failed, detail message: Send post vl request to vim failed."}
         self.assertEqual(retinfo["detail"], response.data["detail"])
     '''
@@ -153,5 +153,5 @@ class TestVlDetailViews(TestCase):
         expect_resp_data = {'vlId': self.vl_inst_id, 'vlName': self.vl_name, 'vlStatus': "active"}
         self.assertEqual(expect_resp_data, response.data)
 
-        response = self.client.get("/api/nslcm/v1/ns/vls/%s" % "notExist")
+        response = self.client.get("/api/nslcm/v1/ns/ns_vls/%s" % "notExist")
         self.assertEqual(status.HTTP_404_NOT_FOUND, response.status_code)