Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing DAGSet ID test #23

Merged
merged 2 commits into from
May 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,18 @@ def test_id_safety(request):
with pytest.raises(ValueError, match="already"):
v1.id = used_vol_id

safe_vol_id = 9876
safe_vol_id = 101
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my own understanding.... this isn't part of the fix, right? Just circumstantial changes that came up in testing? I'm fine to leave them, but want to make sure I understand.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out I added the wrong fix. Thanks for asking about this. I've updated it to include what I think is the correct fix along with comments on the intended tests.

v1.id = safe_vol_id
assert v1.id == safe_vol_id

v2 = Volume.create(model)
v2 = dagmc.Volume.create(model)
assert v2.id == safe_vol_id + 1

safe_vol_id = 101
safe_vol_id = 9876
v1.id = safe_vol_id
del v2

v3 = Volume.create(model)
v3 = dagmc.Volume.create(model)
assert v3.id == safe_vol_id + 1

s1 = model.surfaces_by_id[1]
Expand Down
Loading