summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhewei-cmss <hewei@cmss.chinamobile.com>2019-07-03 16:45:32 +0800
committerhewei-cmss <hewei@cmss.chinamobile.com>2019-07-03 16:45:59 +0800
commit0cd170a12784b85f3cf507a8b9ef56eae6a5dd62 (patch)
treec507d20cbab7300fff83eb364916389cd0265ad5
parentf2a5c03d4d695a5f10c1275aa1aa12c9279b5950 (diff)
fix test ns instant.
Issue-ID: VFC-1436 Signed-off-by: hewei-cmss <hewei@cmss.chinamobile.com> Change-Id: If4810047db4db5aff39a59ade1d3029f65341f71
-rw-r--r--lcm/ns/tests/test_ns_instant.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/lcm/ns/tests/test_ns_instant.py b/lcm/ns/tests/test_ns_instant.py
index 1d6fadb0..8470659b 100644
--- a/lcm/ns/tests/test_ns_instant.py
+++ b/lcm/ns/tests/test_ns_instant.py
@@ -35,10 +35,19 @@ class TestNsInstant(TestCase):
NSInstModel.objects.filter().delete()
self.url = "/api/nslcm/v1/ns/%s/instantiate" % "2"
NSInstModel(id="2", nspackage_id="7", nsd_id="2", status="active").save()
+ self._mock_get_auto_id()
def tearDown(self):
pass
+ def _mock_get_auto_id(self):
+ fake_auto_id = mock.Mock()
+ fake_auto_id.return_value = 1
+ patcher = mock.patch(
+ 'lcm.pub.utils.idutil.get_auto_id',
+ fake_auto_id)
+ patcher.start()
+
@mock.patch.object(restcall, 'call_req')
@mock.patch('lcm.pub.msapi.sdc_run_catalog.parse_nsd', MagicMock(return_value=json.dumps({"model": json.dumps(NSD_MODEL_DICT)})))
@mock.patch.object(BuildInWorkflowThread, 'run')