本文整理汇总了Python中buildbot.master.BuildMaster.stopService方法的典型用法代码示例。如果您正苦于以下问题:Python BuildMaster.stopService方法的具体用法?Python BuildMaster.stopService怎么用?Python BuildMaster.stopService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类buildbot.master.BuildMaster
的用法示例。
在下文中一共展示了BuildMaster.stopService方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: do_test_master
# 需要导入模块: from buildbot.master import BuildMaster [as 别名]
# 或者: from buildbot.master.BuildMaster import stopService [as 别名]
def do_test_master(self):
# create the master and set its config
m = BuildMaster(self.basedir, self.configfile)
# update the DB
yield m.db.setup(check_version=False)
yield m.db.model.upgrade()
# stub out m.db.setup since it was already called above
m.db.setup = lambda: None
# mock reactor.stop (which trial *really* doesn't
# like test code to call!)
mock_reactor = mock.Mock(spec=reactor)
mock_reactor.callWhenRunning = reactor.callWhenRunning
# start the service
yield m.startService(_reactor=mock_reactor)
self.failIf(mock_reactor.stop.called,
"startService tried to stop the reactor; check logs")
# hang out for a fraction of a second, to let startup processes run
d = defer.Deferred()
reactor.callLater(0.01, d.callback, None)
yield d
# stop the service
yield m.stopService()
# and shutdown the db threadpool, as is normally done at reactor stop
m.db.pool.shutdown()
示例2: do_test_master
# 需要导入模块: from buildbot.master import BuildMaster [as 别名]
# 或者: from buildbot.master.BuildMaster import stopService [as 别名]
def do_test_master(self):
# create the master and set its config
m = BuildMaster(self.basedir, self.configfile)
m.config = config.MasterConfig.loadConfig(
self.basedir, self.configfile)
# update the DB
yield m.db.setup(check_version=False)
yield m.db.model.upgrade()
# stub out m.db.setup since it was already called above
m.db.setup = lambda : None
# mock reactor.stop (which trial *really* doesn't
# like test code to call!)
mock_reactor = mock.Mock(spec=reactor)
mock_reactor.callWhenRunning = reactor.callWhenRunning
# start the service
yield m.startService(_reactor=mock_reactor)
self.failIf(mock_reactor.stop.called,
"startService tried to stop the reactor; check logs")
# stop the service
yield m.stopService()
# and shutdown the db threadpool, as is normally done at reactor stop
m.db.pool.shutdown()
示例3: _run_master
# 需要导入模块: from buildbot.master import BuildMaster [as 别名]
# 或者: from buildbot.master.BuildMaster import stopService [as 别名]
def _run_master(self, loaded_config):
# create the master
m = BuildMaster(self.basedir, self.configfile)
# update the DB
yield m.db.setup(check_version=False)
yield m.db.model.upgrade()
# stub out m.db.setup since it was already called above
m.db.setup = lambda: None
# mock reactor.stop (which trial *really* doesn't
# like test code to call!)
mock_reactor = mock.Mock(spec=reactor)
mock_reactor.callWhenRunning = reactor.callWhenRunning
mock_reactor.getThreadPool = reactor.getThreadPool
mock_reactor.callFromThread = reactor.callFromThread
# mock configuration loading
@classmethod
def loadConfig(cls, basedir, filename):
return loaded_config
with mock.patch('buildbot.config.MasterConfig.loadConfig', loadConfig):
# start the service
yield m.startService(_reactor=mock_reactor)
self.failIf(mock_reactor.stop.called,
"startService tried to stop the reactor; check logs")
# hang out for a fraction of a second, to let startup processes run
d = defer.Deferred()
reactor.callLater(0.01, d.callback, None)
yield d
# stop the service
yield m.stopService()
# and shutdown the db threadpool, as is normally done at reactor stop
m.db.pool.shutdown()