summaryrefslogtreecommitdiffstats
path: root/windriver
diff options
context:
space:
mode:
authorYun Huang <yun.huang@windriver.com>2018-06-15 10:47:30 +0800
committerYun Huang <yun.huang@windriver.com>2018-06-15 10:47:30 +0800
commit1fef0c7cd106f102c2b36671b4718fe401ea9687 (patch)
treed1099f068b948862f08de7b103e120310d009c98 /windriver
parentc93ca7e61ba3b34d282e1cf7522bf0b884cce19c (diff)
Add UT for vesagent tasks_processBacklogs
Change-Id: Icdaea1e1d1c0cf7f10b4e64b53a2616c6c3abdea Issue-ID: MULTICLOUD-230 Signed-off-by: Yun Huang <yun.huang@windriver.com>
Diffstat (limited to 'windriver')
-rw-r--r--windriver/titanium_cloud/vesagent/tests_tasks.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/windriver/titanium_cloud/vesagent/tests_tasks.py b/windriver/titanium_cloud/vesagent/tests_tasks.py
index ae3c9718..e749dd8d 100644
--- a/windriver/titanium_cloud/vesagent/tests_tasks.py
+++ b/windriver/titanium_cloud/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