16 from ROOT
import Belle2
22 """Test that we forward globaltags correctly"""
24 """Only one test here ..."""
26 metadata = basf2.get_file_metadata(inputfile)
27 inputtags = metadata.getDatabaseGlobalTag()
28 self.assertNotEqual(inputtags,
"")
31 basf2.conditions.globaltags = [
"A",
"B",
"C",
"A",
"B",
"C",
"C",
"A"]
34 p.add_module(
"RootInput", inputFileName=inputfile)
35 p.add_module(
"RootOutput", outputFileName=
"test.root")
37 with open(
"info.json")
as jobinfo:
38 data = json.load(jobinfo)
40 self.assertIn(
'output_files', data,
"Expecting output file info")
41 self.assertEqual(len(data[
'output_files']), 1,
"Expecting exactly one output file")
42 fileinfo = data[
'output_files'][0]
44 self.assertEqual(fileinfo[
'metadata'][
'globalTag'], f
"A,B,C,{inputtags},Legacy_IP_Information",
45 "Globaltags not forwarded correctly")
46 self.assertEqual(fileinfo[
'stats'][
'events'], 3,
"Number of events is wrong")
49 if __name__ ==
'__main__':
def require_file(filename, data_type="", py_case=None)
def clean_working_directory()