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