6 import validationscript
14 Various test cases for the Script class
19 Test if the xml header in validation scripts are parsed properly
21 with tempfile.NamedTemporaryFile()
as tf:
22 tf.write(b
'#!/usr/bin/env python3\n'
23 b
'# -*- coding: utf-8 -*-\n'
26 b
'<interval>release</interval>'
27 b
'<output>EvtGenSim.root</output>\n'
28 b
'<contact>Thomas Kuhr thomas.kuhr@lmu.de</contact>\n'
29 b
'<description>description_text</description>\n'
37 script = validationscript.Script(tf.name,
"package",
None)
40 self.assertEqual(
"description_text", script.header[
"description"])
41 self.assertEqual(
"Thomas Kuhr thomas.kuhr@lmu.de", script.header[
"contact"][0])
42 self.assertEqual(1, len(script.header[
"output"]))
43 self.assertEqual(
"EvtGenSim.root", script.header[
"output"][0])
44 self.assertEqual(
"release", script.header[
"interval"])
47 if __name__ ==
"__main__":