From 316a5c2f3fe8d39b6336b79710a31b1147f00d75 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Tue, 24 Oct 2023 13:49:14 +0200 Subject: [PATCH] Test also overlapping and non-consecutive bins merging --- pineappl_py/tests/test_grid.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pineappl_py/tests/test_grid.py b/pineappl_py/tests/test_grid.py index 9015c82c..ab0a6e56 100644 --- a/pineappl_py/tests/test_grid.py +++ b/pineappl_py/tests/test_grid.py @@ -201,3 +201,14 @@ def test_merge(self): g2.merge(g3) assert g2.bins() == 2 + + g4 = self.fake_grid([2, 3, 4]) + g5 = self.fake_grid([4, 5, 6]) + assert g4.bins() == 2 + assert g5.bins() == 2 + + with pytest.raises(ValueError, match="NonConsecutiveBins"): + g2.merge(g4) + + with pytest.raises(ValueError, match="NonConsecutiveBins"): + g2.merge(g5)