diff options
Diffstat (limited to 'res/res/resources/tests.py')
-rw-r--r-- | res/res/resources/tests.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/res/res/resources/tests.py b/res/res/resources/tests.py index 2ab5a0a..4bddc71 100644 --- a/res/res/resources/tests.py +++ b/res/res/resources/tests.py @@ -150,7 +150,7 @@ class ResourceTest(TestCase): NfInstModel(nfinstid=vnf_inst_id, nf_name='VNF1').save() StorageInstModel(storageid='s02', vimid='vim01', resouceid='resource01', insttype=1,\ instid=vnf_inst_id, storagetype='desc01', size='ten').save() - response = self.client.get("/openoapi/vnfres/v1/vnfs/%s" % vnf_inst_id) + response = self.client.get("/api/vnfres/v1/vnfs/%s" % vnf_inst_id) self.failUnlessEqual(status.HTTP_200_OK, response.status_code) self.assertEqual(self.test_data, response.data) @@ -159,7 +159,7 @@ class ResourceTest(TestCase): for i in range(1): NfInstModel(nfinstid='%s' % i, nf_name='VNF%s' % i).save() StorageInstModel(storageid='s0%s' % i, vimid='vim0%s' % i, resouceid='resource0%s' % i, insttype=1, instid='%s' % i, storagetype='desc%s' % i, size='ten').save() - response = self.client.get("/openoapi/vnfres/v1/vnfs") + response = self.client.get("/api/vnfres/v1/vnfs") self.failUnlessEqual(status.HTTP_200_OK, response.status_code) # self.assertEqual(self.test_data, response.data) @@ -168,7 +168,7 @@ class ResourceTest(TestCase): nfInst = NfInstModel.objects.get(pk='01') for i in range(1): VmInstModel(vmid='vm%s' % i, vimid='vim%s' % i, resouceid='res%s' % i, instid='%s' % nfInst.nfinstid, insttype=0, vmname='v1', nic_array='nic%s' % i, metadata='meta%s' % i, volume_array='volume%s' % i, server_group='server%s' % i, availability_zone='ava%s' %i, flavor_id='flavor%s' % i, security_groups='sec%s' % i).save() - response = self.client.get("/openoapi/vnfres/v1/%s/vms" % nfInst.nfinstid) + response = self.client.get("/api/vnfres/v1/%s/vms" % nfInst.nfinstid) self.failUnlessEqual(status.HTTP_200_OK, response.status_code) self.assertEqual(self.vms_data, response.data) @@ -177,7 +177,7 @@ class ResourceTest(TestCase): nfInst = NfInstModel.objects.get(pk='01') for i in range(1): FlavourInstModel(flavourid='fla%s' % i, name='fname%s' % i, vcpu='%d' % i, instid='%s' % nfInst.nfinstid, memory='%d' % i, extraspecs='ext%s' % i, vimid='vim%s' % i, resouceid='res%s' % i).save() - response = self.client.get("/openoapi/vnfres/v1/%s/flavors" % nfInst.nfinstid) + response = self.client.get("/api/vnfres/v1/%s/flavors" % nfInst.nfinstid) self.failUnlessEqual(status.HTTP_200_OK, response.status_code) self.assertEqual(self.flavors_data, response.data) @@ -185,31 +185,31 @@ class ResourceTest(TestCase): for i in range(1): NetworkInstModel(networkid='net%s' % i, name='net_name%s' % i, vimid='vim%s' % i, instid='%s' % self.nf_inst_id, resouceid='res%s' % i, insttype='%d' % i).save() - response = self.client.get("/openoapi/vnfres/v1/%s/networks" % self.nf_inst_id) + response = self.client.get("/api/vnfres/v1/%s/networks" % self.nf_inst_id) self.failUnlessEqual(status.HTTP_200_OK, response.status_code) self.assertEqual(self.networks_data, response.data) def test_get_subnets(self): for i in range(1): SubNetworkInstModel(subnetworkid="sub%s" % i, vimid='vim%s' % i, resouceid='res%s' % i, networkid='net%s' % i, insttype='%d' % i, instid='%s' % self.nf_inst_id, name='sub_name%s' % i, cidr="cidr%s" % i).save() - response = self.client.get("/openoapi/vnfres/v1/%s/subnets" % self.nf_inst_id) + response = self.client.get("/api/vnfres/v1/%s/subnets" % self.nf_inst_id) self.failUnlessEqual(status.HTTP_200_OK, response.status_code) self.assertEqual(self.subnets_data, response.data) def test_get_cps(self): for i in range(1): CPInstModel(cpinstanceid="cp%s" % i, cpdid='cpd%s' % i, cpinstancename='cpinstname%s' % i, vlinstanceid='vlinst%s' % i, ownertype='%d' % i, ownerid='%s' % self.nf_inst_id, relatedtype='%d' % i).save() - response = self.client.get("/openoapi/vnfres/v1/%s/cps" % self.nf_inst_id) + response = self.client.get("/api/vnfres/v1/%s/cps" % self.nf_inst_id) self.failUnlessEqual(status.HTTP_200_OK, response.status_code) self.assertEqual(self.cps_data, response.data) def test_get_volumes(self): for i in range(1): StorageInstModel(storageid="st%s" % i, vimid='vim%s' % i, resouceid='res%s' % i, insttype='%d' % i, instid='%s' % self.nf_inst_id, storagetype='stype%s' % i, size='%s' % i).save() - response = self.client.get("/openoapi/vnfres/v1/%s/volumes" % self.nf_inst_id) + response = self.client.get("/api/vnfres/v1/%s/volumes" % self.nf_inst_id) self.assertEqual(self.volumes_data, response.data) self.failUnlessEqual(status.HTTP_200_OK, response.status_code) def test_swagger_ok(self): - resp = self.client.get("/openoapi/vnfres/v1/swagger.json", format='json') + resp = self.client.get("/api/vnfres/v1/swagger.json", format='json') self.assertEqual(resp.status_code, status.HTTP_200_OK, resp.content)
\ No newline at end of file |