Belle II Software  release-08-01-10
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 20 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 104 of file test_validation.py.

104  def test_apply_package_selection(self):
105  """
106  Test if the package selection works and if the required dependecies are
107  properly honored
108  """
109 
110  val = validation.Validation()
111 
112  script1 = validation.Script("val1.py", "tracking", None)
113  script2 = validation.Script("val2.py", "tracking", None)
114  script3 = validation.Script("valOther.py", "other_package", None)
115  script4 = validation.Script(
116  "valOtherNotDepending.py", "other_package", None
117  )
118  script2.dependencies = [script3]
119 
120  val.add_script(script1)
121  val.add_script(script2)
122  val.add_script(script3)
123  val.add_script(script4)
124 
125  # test with honoring dependencies
126  val.apply_package_selection(["tracking"], False)
127 
128  self.assertEqual(3, len(val.scripts))
129  self.assertEqual(
130  1,
131  len(
132  [
133  s
134  for s in val.scripts
135  if s.unique_name() == script3.unique_name()
136  ]
137  ),
138  )
139  self.assertEqual(
140  0,
141  len(
142  [
143  s
144  for s in val.scripts
145  if s.unique_name() == script4.unique_name()
146  ]
147  ),
148  )
149 
150  val_no_deps = validation.Validation()
151 
152  val_no_deps.add_script(script1)
153  val_no_deps.add_script(script2)
154  val_no_deps.add_script(script3)
155  val_no_deps.add_script(script4)
156 
157  # test with honoring dependencies
158  val_no_deps.apply_package_selection(["tracking"], True)
159 
160  self.assertEqual(2, len(val_no_deps.scripts))
161  self.assertEqual(
162  0,
163  len(
164  [
165  s
166  for s in val_no_deps.scripts
167  if s.unique_name() == script3.unique_name()
168  ]
169  ),
170  )
171 

◆ test_interval_selection()

def test_interval_selection (   self)
Test if the interval selection works

Definition at line 26 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 76 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 202 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 172 of file test_validation.py.


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