summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Haibin <haibin.huang@intel.com>2018-09-11 18:46:11 +0800
committerHuang Haibin <haibin.huang@intel.com>2018-09-11 18:46:11 +0800
commiteb433f733a18f16c8fa07b997d726affd6ea14dd (patch)
treeeedf451c78619c598926095177b80cbb7df2756c
parent6f159298aa0792512f22366d776ed13f62e77117 (diff)
Test case for vesagent delete API in ocata
Change-Id: Ie916b35ae80b5dea68dbe648e5409202449a3673 Issue-ID: MULTICLOUD-230 Signed-off-by: Huang Haibin <haibin.huang@intel.com>
-rw-r--r--ocata/ocata/vesagent/tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/ocata/ocata/vesagent/tests.py b/ocata/ocata/vesagent/tests.py
index 4f6d58fb..d6510e70 100644
--- a/ocata/ocata/vesagent/tests.py
+++ b/ocata/ocata/vesagent/tests.py
@@ -73,3 +73,16 @@ class VesAgentCtrlTest(unittest.TestCase):
self.assertEquals(status.HTTP_201_CREATED, response.status_code)
pass
+
+ @mock.patch.object(vesagent_ctrl.VesAgentCtrl, 'clearBacklogsOneVIM')
+ @mock.patch.object(extsys, 'get_vim_by_id')
+ def test_delete(self, mock_get_vim_by_id, mock_clearBacklogsOneVIM):
+ mock_get_vim_by_id.return_value = MOCK_VIM_INFO
+ mock_clearBacklogsOneVIM.return_value = "mocked vesagent_backlogs"
+ mock_request = mock.Mock()
+ mock_request.META = {"testkey": "testvalue"}
+
+ response = self.view.delete(request=mock_request, vimid="windriver-hudson-dc_RegionOne")
+ self.assertEquals(status.HTTP_200_OK, response.status_code)
+
+ pass