当前位置: 首页>>代码示例>>Python>>正文


Python botmaster.FakeBotMaster类代码示例

本文整理汇总了Python中buildbot.test.fake.botmaster.FakeBotMaster的典型用法代码示例。如果您正苦于以下问题:Python FakeBotMaster类的具体用法?Python FakeBotMaster怎么用?Python FakeBotMaster使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了FakeBotMaster类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_setServiceParent_started

 def test_setServiceParent_started(self):
     master = self.master = fakemaster.make_master()
     botmaster = FakeBotMaster(master)
     botmaster.startService()
     bs = self.ConcreteBuildSlave('bot', 'pass')
     bs.setServiceParent(botmaster)
     self.assertEqual(bs.botmaster, botmaster)
     self.assertEqual(bs.master, master)
开发者ID:Markus-M,项目名称:buildbot,代码行数:8,代码来源:test_buildslave.py

示例2: test_setServiceParent_slaveLocks

 def test_setServiceParent_slaveLocks(self):
     """
     http://trac.buildbot.net/ticket/2278
     """
     master = self.master = fakemaster.make_master()
     botmaster = FakeBotMaster(master)
     botmaster.startService()
     lock = locks.SlaveLock('lock')
     bs = self.ConcreteBuildSlave('bot', 'pass', locks = [lock.access("counting")])
     bs.setServiceParent(botmaster)
开发者ID:Markus-M,项目名称:buildbot,代码行数:10,代码来源:test_buildslave.py

示例3: FakeMaster

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,代码行数:49,代码来源:fakemaster.py

示例4: __init__

    def __init__(self, master_id=fakedb.FakeBuildRequestsComponent.MASTER_ID):
        service.MasterService.__init__(self)
        self._master_id = master_id
        self.objectids = []
        self.config = config.MasterConfig()
        self.caches = FakeCaches()
        self.pbmanager = pbmanager.FakePBManager()
        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.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
开发者ID:LiMinggang,项目名称:buildbot,代码行数:29,代码来源:fakemaster.py


注:本文中的buildbot.test.fake.botmaster.FakeBotMaster类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。