Skip to content

Commit

Permalink
tested material clear.
Browse files Browse the repository at this point in the history
  • Loading branch information
MicahGale committed Feb 22, 2025
1 parent 44ff8c8 commit 648ab0d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ def test_mat_get_nuclide_library(
assert iter_key == item_key
assert big_mat_lib.default_libraries[iter_key] == item_val

def test_mat_clear(_, big_mat_lib):
old_mat = big_mat_lib.clone()
old_len = len(big_mat_lib)
assert old_len > 0
big_mat_lib.clear()
assert 0 == len(big_mat_lib)
for part in old_mat.default_libraries:
assert (
old_mat.default_libraries[part] == big_mat_lib.default_libraries[part]
)

def test_mat_get_nuclide_library_bad(_, big_mat_lib):
with pytest.raises(TypeError):
big_mat_lib.get_nuclide_library(5, "nlib")
Expand Down

0 comments on commit 648ab0d

Please sign in to comment.