Belle II Software development
ValidationScriptTest Class Reference
Inheritance diagram for ValidationScriptTest:

Public Member Functions

def test_parse_header (self)
 

Detailed Description

Various test cases for the Script class

Definition at line 18 of file test_validationscript.py.

Member Function Documentation

◆ test_parse_header()

def test_parse_header (   self)
Test if the xml header in validation scripts are parsed properly

Definition at line 24 of file test_validationscript.py.

24 def test_parse_header(self):
25 """
26 Test if the xml header in validation scripts are parsed properly
27 """
28 with tempfile.NamedTemporaryFile() as tf:
29 tf.write(
30 b"#!/usr/bin/env python3\n"
31 b'"""\n'
32 b"<header>\n"
33 b"<interval>release</interval>"
34 b"<output>EvtGenSim.root</output>\n"
35 b"<contact>Thomas Kuhr thomas.kuhr@lmu.de</contact>\n"
36 b"<description>description_text</description>\n"
37 b"</header>\n"
38 b'"""\n'
39 )
40
41 # flush file content, so it can be read by the Script class used
42 # below
43 tf.flush()
44
45 script = validationscript.Script(tf.name, "package", None)
46 script.load_header()
47
48 self.assertEqual("description_text", script.description)
49 self.assertEqual(
50 "Thomas Kuhr thomas.kuhr@lmu.de", script.contact[0]
51 )
52 self.assertEqual(1, len(script.output_files))
53 self.assertEqual("EvtGenSim.root", script.output_files[0])
54 self.assertEqual("release", script.interval)
55
56

The documentation for this class was generated from the following file: