本文整理匯總了Python中ambari_agent.ActionQueue.ActionQueue.commandInProgress方法的典型用法代碼示例。如果您正苦於以下問題:Python ActionQueue.commandInProgress方法的具體用法?Python ActionQueue.commandInProgress怎麽用?Python ActionQueue.commandInProgress使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ambari_agent.ActionQueue.ActionQueue
的用法示例。
在下文中一共展示了ActionQueue.commandInProgress方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_heartbeat_with_task_in_progress
# 需要導入模塊: from ambari_agent.ActionQueue import ActionQueue [as 別名]
# 或者: from ambari_agent.ActionQueue.ActionQueue import commandInProgress [as 別名]
def test_heartbeat_with_task_in_progress(self):
actionQueue = ActionQueue(AmbariConfig.AmbariConfig().getConfig())
actionQueue.commandInProgress= {
'role' : "role",
'actionId' : "actionId",
'taskId' : "taskId",
'stdout' : "stdout",
'clusterName' : "clusterName",
'stderr' : 'none',
'exitCode' : 777,
'serviceName' : "serviceName",
'status' : 'IN_PROGRESS',
'configurations':{'global' : {}},
'roleCommand' : 'START'
}
heartbeat = Heartbeat(actionQueue)
result = heartbeat.build(100)
#print "Heartbeat: " + str(result)
self.assertEquals(len(result['reports']), 1)
self.assertEquals(result['reports'][0]['role'], "role")
self.assertEquals(result['reports'][0]['actionId'], "actionId")
self.assertEquals(result['reports'][0]['taskId'], "taskId")
self.assertEquals(result['reports'][0]['stdout'], "...")
self.assertEquals(result['reports'][0]['clusterName'], "clusterName")
self.assertEquals(result['reports'][0]['stderr'], "...")
self.assertEquals(result['reports'][0]['exitCode'], 777)
self.assertEquals(result['reports'][0]['serviceName'], "serviceName")
self.assertEquals(result['reports'][0]['status'], "IN_PROGRESS")
self.assertEquals(result['reports'][0]['roleCommand'], "START")
pass
示例2: test_heartbeat_no_host_check_cmd_in_progress
# 需要導入模塊: from ambari_agent.ActionQueue import ActionQueue [as 別名]
# 或者: from ambari_agent.ActionQueue.ActionQueue import commandInProgress [as 別名]
def test_heartbeat_no_host_check_cmd_in_progress(self, register_mock):
actionQueue = ActionQueue(AmbariConfig.AmbariConfig().getConfig())
actionQueue.commandInProgress= {
'role' : "role",
'actionId' : "actionId",
'taskId' : "taskId",
'stdout' : "stdout",
'clusterName' : "clusterName",
'stderr' : 'none',
'exitCode' : 777,
'serviceName' : "serviceName",
'status' : 'IN_PROGRESS',
'configurations':{'global' : {}},
'roleCommand' : 'START'
}
heartbeat = Heartbeat(actionQueue)
heartbeat.build(12, 6)
self.assertTrue(register_mock.called)
args, kwargs = register_mock.call_args_list[0]
self.assertTrue(args[2])
self.assertFalse(args[1])