From 33f9ab708384d9ee20afb1f9572a2d6941cc76df Mon Sep 17 00:00:00 2001 From: shimwell Date: Thu, 2 Mar 2023 22:14:14 +0000 Subject: [PATCH] testing muliple reactions for elements+nuclides --- tests/unit_tests/test_plotter.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/unit_tests/test_plotter.py b/tests/unit_tests/test_plotter.py index 15526351a4..be420c3e8b 100644 --- a/tests/unit_tests/test_plotter.py +++ b/tests/unit_tests/test_plotter.py @@ -41,3 +41,17 @@ def test_calculate_cexs_with_element(this, data_type): assert len(energy_grid) > 1 assert len(data) == 1 assert len(data[0]) == len(energy_grid) + + # two types (reaction) + energy_grid, data = openmc.plotter.calculate_cexs( + this=this, data_type=data_type, types=[2, "elastic"] + ) + + assert isinstance(energy_grid, np.ndarray) + assert isinstance(data, np.ndarray) + assert len(energy_grid) > 1 + assert len(data) == 2 + assert len(data[0]) == len(energy_grid) + assert len(data[0]) == len(energy_grid) + # reactions are both the same MT number 2 is elastic + assert np.array_equal(data[0], data[1])