diff --git a/eventio/simtel/objects.py b/eventio/simtel/objects.py index 1143baf..b3cf07f 100644 --- a/eventio/simtel/objects.py +++ b/eventio/simtel/objects.py @@ -79,7 +79,8 @@ class HistoryMeta(EventIOObject): eventio_type = 75 def parse(self): - n_items = read_varint(self) + n_items = read_unsigned_varint(self) + data = {} for _ in range(n_items): k = read_var_string(self) diff --git a/tests/simtel/test_simtel_objects.py b/tests/simtel/test_simtel_objects.py index e6d810c..67e6a56 100644 --- a/tests/simtel/test_simtel_objects.py +++ b/tests/simtel/test_simtel_objects.py @@ -86,7 +86,10 @@ def test_75(): if n_found == 0: assert 'global' in str(o) - assert len(data) == 0 + assert len(data) == 11 + assert b'CONFIG_RELEASE' in data + assert data[b'SIMTEL_RELEASE'] == b'2021-12-16 (development beyond prod-5)' + assert data[b'SIMTEL_BASE_RELEASE'] == b'2021-12-16 (development beyond prod-5)' else: assert f'telescope_id={n_found}' in str(o) assert b'OPTICS_CONFIG_NAME' in data diff --git a/tests/simtel/test_simtelfile.py b/tests/simtel/test_simtelfile.py index 9ebf3d9..b88a217 100644 --- a/tests/simtel/test_simtelfile.py +++ b/tests/simtel/test_simtelfile.py @@ -233,6 +233,7 @@ def test_photons(): def test_history_meta(): with SimTelFile(history_meta_path) as f: - assert isinstance(f.global_meta, dict) - assert isinstance(f.telescope_meta, dict) + assert isinstance(f.global_meta, dict) + assert isinstance(f.telescope_meta, dict) + assert len(f.global_meta) == 11 assert len(f.telescope_meta) == 19