added test for remove eleemnt

This commit is contained in:
Jonathan Shimwell 2022-06-21 14:19:45 +00:00 committed by GitHub
parent edf913b80f
commit acd6c567c3

View file

@ -38,6 +38,17 @@ def test_remove_nuclide():
assert m.nuclides[1].percent == 2.0
def test_remove_elements():
"""Test removing elements."""
m = openmc.Material()
for elem, percent in [('Li', 1.0), ('Be', 1.0)]:
m.add_element(elem, percent)
m.remove_nuclide('Li')
assert len(m.nuclides) == 1
assert m.nuclides == ['Be9']
assert m.nuclides[0].percent == 1.0
def test_elements():
"""Test adding elements."""
m = openmc.Material()