Skip to content

Commit

Permalink
adding test for DAGSets explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
eepeterson committed Mar 27, 2024
1 parent a058fef commit e2000f4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,26 +331,28 @@ def test_area(request):
def test_add_groups(request):
test_file = str(request.path.parent / 'fuel_pin.h5m')
model = dagmc.DAGModel(test_file)
volumes = model.volumes
surfaces = model.surfaces

for group in model.groups.values():
group.delete()

assert len(model.groups) == 0

group_map = {("mat:fuel", 1): [1, 2],
("mat:Graveyard", 0): [6],
("mat:Graveyard", 0): [volumes[6]],
("mat:41", 2): [3],
("boundary:Reflecting", 3): [27, 28, 29]
("boundary:Reflecting", 3): [27, 28, 29],
("boundary:Vacuum", 4): [surfaces[24], surfaces[25]]
}

model.add_groups(group_map)

groups = model.groups
volumes = model.volumes
surfaces = model.surfaces

assert len(groups) == 4
assert len(groups) == 5
assert [1, 2] == sorted(groups['mat:fuel'].get_volume_ids())
assert [6] == groups['mat:Graveyard'].get_volume_ids()
assert [3] == groups['mat:41'].get_volume_ids()
assert [27, 28, 29] == sorted(groups['boundary:Reflecting'].get_surface_ids())
assert [24, 25] == sorted(groups['boundary:Vacuum'].get_surface_ids())

0 comments on commit e2000f4

Please sign in to comment.