From 1d7265de3ea1012bfa935a48ec96384897847b03 Mon Sep 17 00:00:00 2001 From: yardasol Date: Thu, 28 Apr 2022 10:24:31 -0500 Subject: [PATCH] check surface coefficients match between CylinderSector objects from different constructors --- tests/unit_tests/test_surface_composite.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/unit_tests/test_surface_composite.py b/tests/unit_tests/test_surface_composite.py index d4c180d261..4d680ae7c6 100644 --- a/tests/unit_tests/test_surface_composite.py +++ b/tests/unit_tests/test_surface_composite.py @@ -220,14 +220,19 @@ def test_cylinder_sector_from_theta_alpha(): d = (r2 - r1) / 2 theta = 120. alpha = -60. - s = openmc.model.CylinderSector.from_theta_alpha(r1, + theta1 = alpha + theta2 = alpha + theta + s = openmc.model.CylinderSector(r1, r2, theta1, theta2) + s_alt = openmc.model.CylinderSector.from_theta_alpha(r1, r2, theta, alpha) # Check that the angles are correct - assert s._theta1 == alpha - assert s._theta2 == alpha + theta + assert s.plane1.coefficients == s_alt.plane1.coefficients + assert s.plane2.coefficients == s_alt.plane2.coefficients + assert s.inner_cyl.coefficients == s_alt.inner_cyl.coefficients + assert s.outer_cyl.coefficients == s_alt.outer_cyl.coefficients # Check invalid sector width with pytest.raises(ValueError):