21 def _check_list(self, listtype=None, std_function=stdPhotons.stdPhotons, expected_lists=["all"]):
22 """check that a given listtype function works"""
23 testpath = create_path()
24 if (std_function
is stdPhotons.stdPhotons)
and (listtype
is not None):
25 std_function(listtype, path=testpath)
27 std_function(path=testpath)
31 len(testpath.modules()), len(set(expected_lists)) + 1
if listtype ==
'all' else len(set(expected_lists)) + 3,
32 f
"List {listtype} doesn't work with function {std_function.__name__}")
33 self.assertTrue(all((module.type() ==
"ParticleLoader")
or (module.type() ==
"ParticleListManipulator")
34 or (module.type() ==
"ParticleSelector")
35 for module
in testpath.modules()))
39 for module
in testpath.modules():
40 for param
in module.available_params():
41 if param.name ==
'decayStrings':
42 name = param.values[0].split(
':')[1]
43 built_list.append(name)
44 if param.name ==
'outputListName':
45 name = str(param.values).split(
':')[1]
46 built_list.append(name)
49 for a, b
in zip(built_list, expected_lists):
50 self.assertEqual(a, b, f
"Loaded list \'{a}\' instead of \'{b}\' with function {std_function.__name__}")