Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_jjb_zuul_jobs(self):
'Zuul jobs are defined by JJB'
jjb_jobs_file = tempfile.NamedTemporaryFile()
jjb_jobs_file.write(
"\n".join(os.listdir(self.jjb_out_dir)))
jjb_jobs_file.flush()
this_dir = os.path.dirname(os.path.abspath(__file__))
zuul_server = zuul.cmd.server.Server()
zuul_server.args = argparse.Namespace(
config=os.path.join(this_dir, 'fixtures/zuul-dummy.conf'),
validate=jjb_jobs_file.name,
)
zuul_server.read_config()
zuul_server.config.set(
'zuul', 'layout_config',
os.path.join(this_dir, '../zuul/layout.yaml'))
self.assertFalse(zuul_server.test_config(jjb_jobs_file.name))