Skip to content

Commit

Permalink
tests: add another test for random data card
Browse files Browse the repository at this point in the history
  • Loading branch information
Arun Persaud committed Nov 11, 2024
1 parent 4488cdf commit 2531bf5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/test_modify.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,15 @@ def test_set_nps(input_file):

def test_set_seed(input_file):
new = input_file.set_seed(125)
assert input_file.data['rand'].to_mcnp() == 'rand seed 125'
assert new.data['rand'].to_mcnp() == 'rand seed 125'
assert input_file.data['rand'].to_mcnp() == 'rand seed=125'
assert new.data['rand'].to_mcnp() == 'rand seed=125'

# ensure that we set values to odd numbers
for _ in range(5):
input_file.set_seed()
for pair in input_file.data['rand'].pairs:
if pair.keyword == pymcnp.inp.datum.RandomKeyword.SEED:
value = pair.value.value
break

assert value % 2 == 1

0 comments on commit 2531bf5

Please sign in to comment.