diff --git a/test/k4FWCoreTest/options/CheckOutputFiles.py b/test/k4FWCoreTest/options/CheckOutputFiles.py index aabad67f..7f89f6b7 100644 --- a/test/k4FWCoreTest/options/CheckOutputFiles.py +++ b/test/k4FWCoreTest/options/CheckOutputFiles.py @@ -58,11 +58,11 @@ def check_events(filename, number): raise RuntimeError("Number of events does not match expected number") -def check_metadata(filename, keys, values): +def check_metadata(filename, expected_metadata): print(f'Checking file "{filename}" for metadata') podio_reader = podio.root_io.Reader(filename) metadata = podio_reader.get("metadata")[0] - for key, value in zip(keys, values): + for key, value in expected_metadata.items(): if (metaval := metadata.get_parameter(key)) != value: raise RuntimeError( f"Metadata parameter {key} does not match the expected value, got {metaval} but expected {value}" @@ -174,36 +174,36 @@ def check_metadata(filename, keys, values): check_metadata( "functional_metadata.root", - [ - "NumberOfParticles", - "ParticleTime", - "PDGValues", - "MetadataString", - "FinalizeMetadataInt", - ], - [3, 1.5, [1, 2, 3, 4], "hello", 10], + { + "NumberOfParticles": 3, + "ParticleTime": 1.5, + "PDGValues": [1, 2, 3, 4], + "MetadataString": "hello", + "FinalizeMetadataInt": 10, + }, ) check_metadata( "functional_metadata_propagate.root", - [ - "NumberOfParticles", - "ParticleTime", - "PDGValues", - "MetadataString", - "FinalizeMetadataInt", - ], - [3, 1.5, [1, 2, 3, 4], "hello", 10], + { + "NumberOfParticles": 3, + "ParticleTime": 1.5, + "PDGValues": [1, 2, 3, 4], + "MetadataString": "hello", + "FinalizeMetadataInt": 10, + }, ) check_metadata( "functional_metadata_old_algorithm.root", - ["SimTrackerHits__CellIDEncoding"], - ["M:3,S-1:3,I:9,J:9,K-1:6"], + { + "SimTrackerHits__CellIDEncoding": "M:3,S-1:3,I:9,J:9,K-1:6", + }, ) check_metadata( "functional_metadata_old_algorithm_propagate.root", - ["SimTrackerHits__CellIDEncoding"], - ["M:3,S-1:3,I:9,J:9,K-1:6"], + { + "SimTrackerHits__CellIDEncoding": "M:3,S-1:3,I:9,J:9,K-1:6", + }, )