Skip to content

Commit

Permalink
test: Add hash check to pythia8 output (#1461)
Browse files Browse the repository at this point in the history
This adds a simple ROOT hash check to the Pythia8 particles output.
  • Loading branch information
paulgessinger committed Aug 23, 2022
1 parent 6410b0d commit 4fbc5bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Examples/Python/tests/root_file_hashes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,5 @@ test_vertex_fitting_reading[AMVF-True-100]__performance_vertexing.root: 202f06dc

test_bfield_writing__solenoid.root: 85c03b7ca7e37d078f8a17233a6ce878faf51db4edd6a189d9e2c5f826ea1a39
test_bfield_writing__solenoid2.root: 531b302c45d042749f5ef08004909309c423ce5a8d977bf462ea90a1c75eb21b

test_pythia8__pythia8_particles.root: 7821e866de83a4e81a1ad76cb742f9d18ecccfd1d0deebd1baa582880a1a6511
5 changes: 3 additions & 2 deletions Examples/Python/tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def assert_entries(root_file, tree_name, exp):


@pytest.mark.slow
def test_pythia8(tmp_path, seq):
def test_pythia8(tmp_path, seq, assert_root_hash):
from pythia8 import runPythia8

(tmp_path / "csv").mkdir()
Expand All @@ -75,14 +75,15 @@ def test_pythia8(tmp_path, seq):

events = seq.config.events

runPythia8(str(tmp_path), s=seq).run()
runPythia8(str(tmp_path), outputRoot=True, outputCsv=True, s=seq).run()

del seq

fp = tmp_path / "pythia8_particles.root"
assert fp.exists()
assert fp.stat().st_size > 2**10 * 50
assert_entries(fp, "particles", events)
assert_root_hash(fp.name, fp)

assert len(list((tmp_path / "csv").iterdir())) > 0
assert_csv_output(tmp_path / "csv", "particles")
Expand Down

0 comments on commit 4fbc5bf

Please sign in to comment.