本文整理匯總了Python中pymesos.MesosSchedulerDriver.acknowledgeOperationStatusUpdate方法的典型用法代碼示例。如果您正苦於以下問題:Python MesosSchedulerDriver.acknowledgeOperationStatusUpdate方法的具體用法?Python MesosSchedulerDriver.acknowledgeOperationStatusUpdate怎麽用?Python MesosSchedulerDriver.acknowledgeOperationStatusUpdate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pymesos.MesosSchedulerDriver
的用法示例。
在下文中一共展示了MesosSchedulerDriver.acknowledgeOperationStatusUpdate方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_acknowledge_operation_status_update
# 需要導入模塊: from pymesos import MesosSchedulerDriver [as 別名]
# 或者: from pymesos.MesosSchedulerDriver import acknowledgeOperationStatusUpdate [as 別名]
def test_acknowledge_operation_status_update(mocker):
ID = str(uuid.uuid4())
sched = mocker.Mock()
framework = {'id': {'value': ID}}
master = mocker.Mock()
driver = MesosSchedulerDriver(sched, framework, master)
driver._send = mocker.Mock()
agent_id = dict(value=str(uuid.uuid4()))
operation_id = dict(value=str(uuid.uuid4()))
uid = encode_data(uuid.uuid4().bytes)
status = {
'agent_id': agent_id,
'operation_id': operation_id,
'uuid': uid
}
driver.acknowledgeOperationStatusUpdate(status)
driver._send.assert_not_called()
driver._stream_id = 'a-stream-id'
driver.acknowledgeOperationStatusUpdate(status)
driver._send.assert_called_once_with({
'type': 'ACKNOWLEDGE_OPERATION_STATUS',
'framework_id': {
'value': ID
},
'acknowledge_operation_status': {
'agent_id': agent_id,
'operation_id': operation_id,
'uuid': uid,
}
})