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

Public Member Functions

def test_interval_selection (self)
 
def test_interval_selection_default (self)
 
def test_apply_package_selection (self)
 
def test_parse_header (self)
 
def test_meta_option_parser (self)
 

Detailed Description

Various test cases for the validation module

Definition at line 13 of file test_validation.py.

Member Function Documentation

◆ test_apply_package_selection()

def test_apply_package_selection (   self)
Test if the package selection works and if the required dependecies are
properly honored

Definition at line 91 of file test_validation.py.

91  def test_apply_package_selection(self):
92  """
93  Test if the package selection works and if the required dependecies are
94  properly honored
95  """
96 
97  val = validation.Validation()
98 
99  script1 = validation.Script("val1.py", "tracking", None)
100  script2 = validation.Script("val2.py", "tracking", None)
101  script3 = validation.Script("valOther.py", "other_package", None)
102  script4 = validation.Script("valOtherNotDepending.py", "other_package",
103  None)
104  script2.dependencies = [script3]
105 
106  val.add_script(script1)
107  val.add_script(script2)
108  val.add_script(script3)
109  val.add_script(script4)
110 
111  # test with honoring dependencies
112  val.apply_package_selection(["tracking"], False)
113 
114  self.assertEqual(3, len(val.scripts))
115  self.assertEqual(
116  1,
117  len([
118  s for s in val.scripts
119  if s.unique_name() == script3.unique_name()
120  ])
121  )
122  self.assertEqual(
123  0,
124  len([
125  s for s in val.scripts
126  if s.unique_name() == script4.unique_name()
127  ])
128  )
129 
130  val_no_deps = validation.Validation()
131 
132  val_no_deps.add_script(script1)
133  val_no_deps.add_script(script2)
134  val_no_deps.add_script(script3)
135  val_no_deps.add_script(script4)
136 
137  # test with honoring dependencies
138  val_no_deps.apply_package_selection(["tracking"], True)
139 
140  self.assertEqual(2, len(val_no_deps.scripts))
141  self.assertEqual(
142  0,
143  len([
144  s for s in val_no_deps.scripts
145  if s.unique_name() == script3.unique_name()
146  ])
147  )
148 

◆ test_interval_selection()

def test_interval_selection (   self)
Test if the interval selection works

Definition at line 19 of file test_validation.py.

◆ test_interval_selection_default()

def test_interval_selection_default (   self)
Test if the interval selection works if there is no
interval setting in the validation header

Definition at line 65 of file test_validation.py.

◆ test_meta_option_parser()

def test_meta_option_parser (   self)
Test if the meta options parsers behaves nice

Definition at line 177 of file test_validation.py.

◆ test_parse_header()

def test_parse_header (   self)
Test if the interval selection works if there is no
interval setting in the validation header

Definition at line 149 of file test_validation.py.


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