Skip to content

Commit

Permalink
Add test for group creation
Browse files Browse the repository at this point in the history
  • Loading branch information
paulromano committed Apr 26, 2024
1 parent e2023fc commit deb9433
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,22 @@ def test_group_merge(request):
assert 3 in fuel_group.volumes_by_id


def test_group_create(request):
test_file = str(request.path.parent / 'fuel_pin.h5m')
model = dagmc.DAGModel(test_file)
orig_num_groups = len(model.groups)

# Create two new groups
new_group1 = dagmc.Group.create(model, 'mat:slime')
new_group2 = model.create_group('mat:plastic')

assert 'mat:slime' in model.groups_by_name
assert 'mat:plastic' in model.groups_by_name
assert model.groups_by_name['mat:slime'] == new_group1
assert model.groups_by_name['mat:plastic'] == new_group2
assert len(model.groups) == orig_num_groups + 2


def test_volume(request):
test_file = str(request.path.parent / 'fuel_pin.h5m')
model = dagmc.DAGModel(test_file)
Expand Down

0 comments on commit deb9433

Please sign in to comment.