當前位置: 首頁>>代碼示例>>Python>>正文


Python FakeBotMaster.setServiceParent方法代碼示例

本文整理匯總了Python中buildbot.test.fake.botmaster.FakeBotMaster.setServiceParent方法的典型用法代碼示例。如果您正苦於以下問題:Python FakeBotMaster.setServiceParent方法的具體用法?Python FakeBotMaster.setServiceParent怎麽用?Python FakeBotMaster.setServiceParent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在buildbot.test.fake.botmaster.FakeBotMaster的用法示例。


在下文中一共展示了FakeBotMaster.setServiceParent方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: FakeMaster

# 需要導入模塊: from buildbot.test.fake.botmaster import FakeBotMaster [as 別名]
# 或者: from buildbot.test.fake.botmaster.FakeBotMaster import setServiceParent [as 別名]
class FakeMaster(service.MasterService):

    """
    Create a fake Master instance: a Mock with some convenience
    implementations:

    - Non-caching implementation for C{self.caches}
    """

    def __init__(self, reactor,
                 master_id=fakedb.FakeBuildRequestsComponent.MASTER_ID):
        super().__init__()
        self._master_id = master_id
        self.reactor = reactor
        self.objectids = {}
        self.config = config.MasterConfig()
        self.caches = FakeCaches()
        self.pbmanager = pbmanager.FakePBManager()
        self.initLock = defer.DeferredLock()
        self.basedir = 'basedir'
        self.botmaster = FakeBotMaster()
        self.botmaster.setServiceParent(self)
        self.status = FakeStatus()
        self.status.setServiceParent(self)
        self.name = 'fake:/master'
        self.masterid = master_id
        self.workers = bworkermanager.FakeWorkerManager()
        self.workers.setServiceParent(self)
        self.machine_manager = FakeMachineManager()
        self.machine_manager.setServiceParent(self)
        self.log_rotation = FakeLogRotation()
        self.db = mock.Mock()
        self.next_objectid = 0

        def getObjectId(sched_name, class_name):
            k = (sched_name, class_name)
            try:
                rv = self.objectids[k]
            except KeyError:
                rv = self.objectids[k] = self.next_objectid
                self.next_objectid += 1
            return defer.succeed(rv)
        self.db.state.getObjectId = getObjectId

    def getObjectId(self):
        return defer.succeed(self._master_id)

    def subscribeToBuildRequests(self, callback):
        pass
開發者ID:buildbot,項目名稱:buildbot,代碼行數:51,代碼來源:fakemaster.py


注:本文中的buildbot.test.fake.botmaster.FakeBotMaster.setServiceParent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。