summaryrefslogtreecommitdiffstats
path: root/windriver/titanium_cloud
diff options
context:
space:
mode:
authorYun Huang <yun.huang@windriver.com>2018-06-15 14:06:39 +0800
committerYun Huang <yun.huang@windriver.com>2018-06-15 14:06:39 +0800
commit2cb07826f47cb30ad7a774aa161890cac6aa555c (patch)
treecca1b140c421323e63aa8864c51ba0dcba85c5a4 /windriver/titanium_cloud
parent8524d878a3aca0030b42f6ff28afe73bd32dcb84 (diff)
Test case for vesagent getBacklogsOneVIM
Change-Id: I542e95fc830d7f64d4e1cdc9dfa5436efbea72f4 Issue-ID: MULTICLOUD-230 Signed-off-by: Yun Huang <yun.huang@windriver.com>
Diffstat (limited to 'windriver/titanium_cloud')
-rw-r--r--windriver/titanium_cloud/vesagent/tests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/windriver/titanium_cloud/vesagent/tests.py b/windriver/titanium_cloud/vesagent/tests.py
index c7c95ed9..f06ecd4b 100644
--- a/windriver/titanium_cloud/vesagent/tests.py
+++ b/windriver/titanium_cloud/vesagent/tests.py
@@ -87,3 +87,13 @@ class VesAgentCtrlTest(unittest.TestCase):
self.assertEquals(status.HTTP_200_OK, response.status_code)
pass
+
+ @mock.patch.object(cache, 'get')
+ def test_getBacklogsOneVIM(self, mock_get):
+ mock_vesagent_config = {"backlogs": [{"backlog_uuid": "ce2d7597-22e1-4239-890f-bc303bd67076", "server_id": "c4b575fa-ed85-4642-ab4b-335cb5744721", "tenant_id": "0e148b76ee8c42f78d37013bf6b7b1ae", "api_method": "GET", "source": "onap-aaf", "api_link": "/onaplab_RegionOne/compute/v2.1/0e148b76ee8c42f78d37013bf6b7b1ae/servers/c4b575fa-ed85-4642-ab4b-335cb5744721", "domain": "fault", "type": "vm", "tenant": "VIM"}], "poll_interval_default": 10, "vimid": "onaplab_RegionOne", "subscription": {"username": "user", "password": "password", "endpoint": "http://127.0.0.1:9005/sample"}}
+ mock_get.return_value = json.dumps(mock_vesagent_config)
+
+ vesAgentConfig = self.view.getBacklogsOneVIM(vimid="windriver-hudson-dc_RegionOne")
+ self.assertEquals(vesAgentConfig, mock_vesagent_config)
+
+ pass