13 import validationscript
21 Various test cases for the Script class
26 Test if the xml header in validation scripts are parsed properly
28 with tempfile.NamedTemporaryFile()
as tf:
30 b
"#!/usr/bin/env python3\n"
31 b
"# -*- coding: utf-8 -*-\n"
34 b
"<interval>release</interval>"
35 b
"<output>EvtGenSim.root</output>\n"
36 b
"<contact>Thomas Kuhr thomas.kuhr@lmu.de</contact>\n"
37 b
"<description>description_text</description>\n"
46 script = validationscript.Script(tf.name,
"package",
None)
49 self.assertEqual(
"description_text", script.description)
51 "Thomas Kuhr thomas.kuhr@lmu.de", script.contact[0]
53 self.assertEqual(1, len(script.output_files))
54 self.assertEqual(
"EvtGenSim.root", script.output_files[0])
55 self.assertEqual(
"release", script.interval)
58 if __name__ ==
"__main__":
def test_parse_header(self)