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