9'''Test for checking if the low_multiplicity_sorcery package works.'''
12import b2test_utils
as b2tu
13import low_multiplicity_sorcery
as lms
16def run_lms_generation(event_codes):
17 '''Create and process a path where lms.add_generators is used.'''
18 with b2tu.clean_working_directory():
19 n_events = 10000
if event_code
is lms.EventCodes_llXX
else 500
20 b2.set_random_seed(
'lms')
22 main.add_module(
'EventInfoSetter')
23 lms.add_generators(path=main, event_codes=event_codes)
24 b2.process(main, n_events)
29for event_code
in [lms.EventCodes_llXX, lms.EventCodes_hhISR]:
30 b2.B2INFO(f
'Running the test for {"llXX" if event_code is lms.EventCodes_llXX else "hhISR"}')
31 return_code = b2tu.run_in_subprocess(target=run_lms_generation, event_codes=event_code)
33 b2.B2FATAL(f
'low_multiplicity_sorcery fails when generating {"llXX" if event_code is lms.EventCodes_llXX else "hhISR"}')