Belle II Software  release-05-02-19
ValidationScriptTest Class Reference
Inheritance diagram for ValidationScriptTest:
Collaboration diagram for ValidationScriptTest:

Public Member Functions

def test_parse_header (self)
 

Detailed Description

Various test cases for the Script class

Definition at line 11 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 17 of file test_validationscript.py.

17  def test_parse_header(self):
18  """
19  Test if the xml header in validation scripts are parsed properly
20  """
21  with tempfile.NamedTemporaryFile() as tf:
22  tf.write(b'#!/usr/bin/env python3\n'
23  b'# -*- coding: utf-8 -*-\n'
24  b'"""\n'
25  b'<header>\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'
30  b'</header>\n'
31  b'"""\n')
32 
33  # flush file content, so it can be read by the Script class used
34  # below
35  tf.flush()
36 
37  script = validationscript.Script(tf.name, "package", None)
38  script.load_header()
39 
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"])
45 
46 

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