summaryrefslogtreecommitdiffstats
path: root/ocata
diff options
context:
space:
mode:
authorYun Huang <yun.huang@windriver.com>2018-07-04 18:36:07 +0800
committerYun Huang <yun.huang@windriver.com>2018-07-04 18:36:07 +0800
commit48120d383ffb4b925862f015d4fe132967d16d5a (patch)
tree898c1eedcfddfa98acb9dbd0a6f808ea86700310 /ocata
parentafde14edd0c7a29612ccb4cfafa840103ce8c694 (diff)
Add ocata UT for vesagent tasks_processBacklogs
Change-Id: I721ac5ba404550a076496e5bf51c697b79e1283d Issue-ID: MULTICLOUD-230 Signed-off-by: Yun Huang <yun.huang@windriver.com>
Diffstat (limited to 'ocata')
-rw-r--r--ocata/ocata/vesagent/tests_tasks.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/ocata/ocata/vesagent/tests_tasks.py b/ocata/ocata/vesagent/tests_tasks.py
index a139c51b..e1e3c5c8 100644
--- a/ocata/ocata/vesagent/tests_tasks.py
+++ b/ocata/ocata/vesagent/tests_tasks.py
@@ -67,4 +67,16 @@ class VesTaskTest(unittest.TestCase):
self.assertEquals(None, result)
pass
+ @mock.patch.object(tasks, 'processBacklogsOfOneVIM')
+ @mock.patch.object(cache, 'get')
+ def test_tasks_processBacklogs(self, mock_cache_get, mock_tasks_processBacklogsOfOneVIM):
+ mock_VesAgentBacklogs_vimlist = ["windriver-hudson-dc_RegionOne"]
+ COUNT_TIME_SLOT_ONE_VIM = (1, 1)
+ mock_tasks_processBacklogsOfOneVIM.return_value = COUNT_TIME_SLOT_ONE_VIM
+ mock_cache_get.side_effect= [
+ json.dumps(mock_VesAgentBacklogs_vimlist),
+ ]
+ result = tasks.processBacklogs()
+ self.assertEquals(COUNT_TIME_SLOT_ONE_VIM, result)
+ pass