Belle II Software  release-08-01-10
SetModuleParameters Class Reference
Inheritance diagram for SetModuleParameters:
Collaboration diagram for SetModuleParameters:

Public Member Functions

def setUp (self)
 
def check_parameters (self, module, **params)
 
def check_unset (self, module)
 
def test_simple (self)
 
def test_double (self)
 
def test_empty (self)
 
def test_missing (self)
 
def test_undefined_param (self)
 
def test_condition (self)
 
def test_condition_recursive (self)
 
def test_subevent (self)
 
def test_subevent_recursive (self)
 
def test_condition_subevent (self)
 

Public Attributes

 m1
 first test module
 
 m2
 second test module
 
 m3
 third test module
 
 path
 main test path
 
 subpath
 secondary test path
 

Detailed Description

Test fixture to check setting of parameters for modules in a path by name

Definition at line 17 of file module_setparameters.py.

Member Function Documentation

◆ check_parameters()

def check_parameters (   self,
  module,
**  params 
)
Check if the parameters of a module are set explicitly to a given value

module: basf2.Module instance
params: named parameters of to check for

Definition at line 39 of file module_setparameters.py.

39  def check_parameters(self, module, **params):
40  """Check if the parameters of a module are set explicitly to a given value
41 
42  module: basf2.Module instance
43  params: named parameters of to check for
44  """
45  for p in module.available_params():
46  if p.name in params:
47  self.assertTrue(p.setInSteering)
48  self.assertEqual(p.values, params[p.name])
49 

◆ check_unset()

def check_unset (   self,
  module 
)
Check that all parameters of a given module are not set explicitely

Definition at line 50 of file module_setparameters.py.

◆ setUp()

def setUp (   self)
Setup a path with a few EventInfoSetter modules with special names

Definition at line 20 of file module_setparameters.py.

◆ test_condition()

def test_condition (   self)
check that modules in a condition sub path are not affected by default

Definition at line 90 of file module_setparameters.py.

◆ test_condition_recursive()

def test_condition_recursive (   self)
check that modules in a condition sub path are affected in recursive mode

Definition at line 98 of file module_setparameters.py.

◆ test_condition_subevent()

def test_condition_subevent (   self)
check that it also works with a conditions and a for_each sub path in recursive mode

Definition at line 122 of file module_setparameters.py.

◆ test_double()

def test_double (   self)
Check that it also works if more than one module with the name exists

Definition at line 67 of file module_setparameters.py.

◆ test_empty()

def test_empty (   self)
Make sure that not supplying any parameters gives a ValueError

Definition at line 75 of file module_setparameters.py.

◆ test_missing()

def test_missing (   self)
Make sure that not finding any module of the given name raises a KeyError

Definition at line 80 of file module_setparameters.py.

◆ test_simple()

def test_simple (   self)
Check setting the parameters for one module and that it does not affect the other modules

Definition at line 55 of file module_setparameters.py.

◆ test_subevent()

def test_subevent (   self)
check that modules in a for_each sub path are not affected by default

Definition at line 106 of file module_setparameters.py.

◆ test_subevent_recursive()

def test_subevent_recursive (   self)
check that modules in a for_each sub path are affected in recursive mode

Definition at line 114 of file module_setparameters.py.

◆ test_undefined_param()

def test_undefined_param (   self)
Make sure that being unable to set the parameter raises a RuntimeError

Definition at line 85 of file module_setparameters.py.


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