Belle II Software  release-08-01-10
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 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"# -*- coding: utf-8 -*-\n"
32  b'"""\n'
33  b"<header>\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"
38  b"</header>\n"
39  b'"""\n'
40  )
41 
42  # flush file content, so it can be read by the Script class used
43  # below
44  tf.flush()
45 
46  script = validationscript.Script(tf.name, "package", None)
47  script.load_header()
48 
49  self.assertEqual("description_text", script.description)
50  self.assertEqual(
51  "Thomas Kuhr thomas.kuhr@lmu.de", script.contact[0]
52  )
53  self.assertEqual(1, len(script.output_files))
54  self.assertEqual("EvtGenSim.root", script.output_files[0])
55  self.assertEqual("release", script.interval)
56 
57 

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