Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@classmethod
def setUpClass(cls):
# Craft our own zuul.conf
wmf_zuul_layout = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'../zuul/layout.yaml')
cfg = ConfigParser.ConfigParser()
cfg.add_section('zuul')
cfg.set('zuul', 'layout_config', wmf_zuul_layout)
cls.state_dir = tempfile.mkdtemp()
cfg.set('zuul', 'state_dir', cls.state_dir)
# Reporters and Triggers are registered by zuul-server, not the
# Scheduler class:
cls.sched = zuul.scheduler.Scheduler(cfg)
cls.sched.registerConnections({
'gerrit': FakeConnection('gerrit', {})
})
cls.sched._doReconfigureEvent(ReconfigureEvent(cfg))