summaryrefslogtreecommitdiffstats
path: root/windriver/titanium_cloud/vesagent
diff options
context:
space:
mode:
authorYun Huang <yun.huang@windriver.com>2018-06-15 14:01:55 +0800
committerYun Huang <yun.huang@windriver.com>2018-06-15 14:01:55 +0800
commit8524d878a3aca0030b42f6ff28afe73bd32dcb84 (patch)
tree2bba21664415eaebe36f64f3fa30523f327f27ba /windriver/titanium_cloud/vesagent
parent46c1ee7f60a93fe474cdb57618c80cb96a239f09 (diff)
Test case for vesagent delete API
Change-Id: I6c9de8c5b3d797f63413c543665880e9948f7f12 Issue-ID: MULTICLOUD-230 Signed-off-by: Yun Huang <yun.huang@windriver.com>
Diffstat (limited to 'windriver/titanium_cloud/vesagent')
-rw-r--r--windriver/titanium_cloud/vesagent/tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/windriver/titanium_cloud/vesagent/tests.py b/windriver/titanium_cloud/vesagent/tests.py
index 520c8ace..c7c95ed9 100644
--- a/windriver/titanium_cloud/vesagent/tests.py
+++ b/windriver/titanium_cloud/vesagent/tests.py
@@ -74,3 +74,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