From 90e7e1d3f06f6074b7574272cc0d04fae8f254ef Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 19 Apr 2023 12:22:46 +0100 Subject: [PATCH] added outline to plot testing --- tests/unit_tests/test_plots.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/unit_tests/test_plots.py b/tests/unit_tests/test_plots.py index 183341c26e..ee3b2c1e27 100644 --- a/tests/unit_tests/test_plots.py +++ b/tests/unit_tests/test_plots.py @@ -12,6 +12,7 @@ def myplot(): plot.filename = 'myplot' plot.type = 'slice' plot.basis = 'yz' + plot.outline = True plot.background = 'black' plot.background = (0, 0, 0) @@ -59,26 +60,31 @@ def myprojectionplot(): plot.overlap_color = (255, 211, 0) plot.overlap_color = 'yellow' - + plot.wireframe_thickness = 2 plot.level = 1 return plot + def test_attributes(myplot): assert myplot.name == 'myplot' + def test_attributes_proj(myprojectionplot): assert myprojectionplot.name == 'myprojectionplot' + def test_repr(myplot): r = repr(myplot) assert isinstance(r, str) + def test_repr_proj(myprojectionplot): r = repr(myprojectionplot) assert isinstance(r, str) + def test_from_geometry(): width = 25. s = openmc.Sphere(r=width/2, boundary_type='vacuum') @@ -155,8 +161,8 @@ def test_plots(run_in_tmpdir): # from_xml new_plots = openmc.Plots.from_xml() - assert len(plots) - assert plots[0].origin == p1.origin - assert plots[0].colors == p1.colors - assert plots[0].mask_components == p1.mask_components - assert plots[1].origin == p2.origin + assert len(new_plots) + assert new_plots[0].origin == p1.origin + assert new_plots[0].colors == p1.colors + assert new_plots[0].mask_components == p1.mask_components + assert new_plots[1].origin == p2.origin