Skip to content

Commit

Permalink
Updated tests for new set like behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
MicahGale committed Nov 30, 2024
1 parent e05dca7 commit 6efea24
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/test_numbered_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ def test_update(_):
cells.update({5})
cell = montepy.Cell()
cell.number = 1
with pytest.raises(NumberConflictError):
cells.update([cell])
cells.update([cell])
assert cells[1] is cell_list[0]
assert cells[1] is not cell

def test_append_renumber(self, cp_simple_problem):
cells = copy.deepcopy(cp_simple_problem.cells)
Expand Down Expand Up @@ -475,7 +476,8 @@ def test_numbered_set_logic(_, mats_sets, name, operator):
assert new_nums == operator(mats1_nums, mats2_nums)

@pytest.mark.parametrize(
"name", ["iand", "ior", "isub", "ixor", "sym_diff", "diff"]
"name",
["iand", "ior", "isub", "ixor", "sym_diff", "diff", "union", "intersection"],
)
def test_numbered_set_logic_update(_, mats_sets, name):
def operator(a, b):
Expand All @@ -491,6 +493,10 @@ def operator(a, b):
a.symmetric_difference_update(b)
elif name == "diff":
a.difference_update(b)
elif name == "union":
a.update(b)
elif name == "intersection":
a.intersection_update(b)

mats1, mats2 = mats_sets
mats1_nums = set(mats1.keys())
Expand Down

0 comments on commit 6efea24

Please sign in to comment.