aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaopengzhang <zhang.maopeng1@zte.com.cn>2019-07-09 11:51:18 +0800
committermaopengzhang <zhang.maopeng1@zte.com.cn>2019-07-09 11:51:18 +0800
commiteb6f5bef87dbb375f81095c9620976de0904631d (patch)
tree8413fdb9ac152e3cb7d250fa23b37c8b8a427a54
parenteeed30ac24b04c5fd7b3af511b6b5070bd2cc605 (diff)
refactor job url const
refactor workflow test Change-Id: I27671bf2946674b7e2922ab177f078299c64a99c Issue-ID: VFC-1431 Signed-off-by: maopengzhang <zhang.maopeng1@zte.com.cn>
-rw-r--r--lcm/workflows/tests.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/lcm/workflows/tests.py b/lcm/workflows/tests.py
index 460e351d..61f9e313 100644
--- a/lcm/workflows/tests.py
+++ b/lcm/workflows/tests.py
@@ -19,7 +19,7 @@ import unittest
import mock
from django.test import Client
from rest_framework import status
-
+from lcm.jobs.const import JOB_INSTANCE_URI, JOB_INSTANCE_RESPONSE_ID_URI
from lcm.pub.database.models import WFPlanModel
from lcm.pub.utils import restcall
from lcm.ns.biz.ns_lcm_op_occ import NsLcmOpOcc
@@ -115,19 +115,19 @@ class WorkflowViewTest(unittest.TestCase):
[0, json.JSONEncoder().encode({
"sfcStatus": "active"
}), '201'],
- "/api/nslcm/v1/jobs/11?responseId=0":
+ JOB_INSTANCE_RESPONSE_ID_URI % ("11", "0"):
[0, json.JSONEncoder().encode({"responseDescriptor": {
"responseId": "1",
"progress": 100,
"statusDescription": "ok"
}}), '200'],
- "/api/nslcm/v1/jobs/111?responseId=0":
+ JOB_INSTANCE_RESPONSE_ID_URI % ("111", "0"):
[0, json.JSONEncoder().encode({"responseDescriptor": {
"responseId": "1",
"progress": 100,
"statusDescription": "ok"
}}), '200'],
- "/api/nslcm/v1/jobs/{jobId}".format(jobId=job_id):
+ JOB_INSTANCE_URI % job_id:
[0, '{}', '201'],
"api/nslcm/v1/ns/{nsInstanceId}/postdeal".format(nsInstanceId=ns_inst_id):
[0, '{}', '201']
@@ -161,7 +161,7 @@ class WorkflowViewTest(unittest.TestCase):
"detail": "vl1",
"vlId": "1"
}), '201'],
- "/api/nslcm/v1/jobs/{jobId}".format(jobId=job_id):
+ JOB_INSTANCE_URI % job_id:
[0, '{}', '201'],
"api/nslcm/v1/ns/{nsInstanceId}/postdeal".format(nsInstanceId=ns_inst_id):
[0, '{}', '201']
@@ -204,13 +204,13 @@ class WorkflowViewTest(unittest.TestCase):
[0, json.JSONEncoder().encode({
"vnfStatus": "error"
}), '201'],
- "/api/nslcm/v1/jobs/11?responseId=0":
+ JOB_INSTANCE_RESPONSE_ID_URI % ("11", "0"):
[0, json.JSONEncoder().encode({"responseDescriptor": {
"responseId": "1",
"progress": 100,
"statusDescription": "ok"
}}), '200'],
- "/api/nslcm/v1/jobs/{jobId}".format(jobId=job_id):
+ JOB_INSTANCE_URI % job_id:
[0, '{}', '201'],
"api/nslcm/v1/ns/{nsInstanceId}/postdeal".format(nsInstanceId=ns_inst_id):
[0, '{}', '201']