mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Adding a test for restart runs
This commit is contained in:
parent
0e10a7da47
commit
ee2f0f2c53
1 changed files with 23 additions and 0 deletions
23
tests/unit_tests/test_restart.py
Normal file
23
tests/unit_tests/test_restart.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import openmc
|
||||
|
||||
import pytest
|
||||
|
||||
def test_restart(run_in_tmpdir):
|
||||
|
||||
pincell = openmc.examples.pwr_pin_cell()
|
||||
|
||||
# run the pincell
|
||||
sp_file = pincell.run()
|
||||
|
||||
# run a restart with the resulting statepoint
|
||||
# and the settings unchanged
|
||||
|
||||
with pytest.raises(RuntimeError, match='is smaller than the number of batches'):
|
||||
pincell.run(restart_file=sp_file)
|
||||
|
||||
# update the number of batches and run again
|
||||
pincell.settings.batches = 15
|
||||
sp_file = pincell.run(restart_file=sp_file)
|
||||
|
||||
sp = openmc.StatePoint(sp_file)
|
||||
assert sp.n_batches == 15
|
||||
Loading…
Add table
Add a link
Reference in a new issue