mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
updated fixed_source test and added simple flux tally for comparison
This commit is contained in:
parent
fa217cc6d0
commit
bfbc929e66
4 changed files with 55 additions and 2 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import os
|
||||
from subprocess import Popen, STDOUT, PIPE
|
||||
import filecmp
|
||||
|
||||
pwd = os.path.dirname(__file__)
|
||||
|
||||
|
|
@ -15,11 +16,22 @@ def test_run():
|
|||
print(proc.communicate()[0])
|
||||
assert returncode == 0
|
||||
|
||||
def test_created_statepoint():
|
||||
def test_statepoint_exists():
|
||||
assert os.path.exists(pwd + '/statepoint.10.binary')
|
||||
|
||||
def test_output_exists():
|
||||
assert os.path.exists(pwd + '/tallies.out')
|
||||
|
||||
def test_results():
|
||||
os.system('python results.py')
|
||||
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
|
||||
if not compare:
|
||||
os.system('cp results_test.dat results_error.dat')
|
||||
assert compare
|
||||
|
||||
def teardown():
|
||||
output = [pwd + '/statepoint.10.binary']
|
||||
output = [pwd + '/statepoint.10.binary', pwd + '/tallies.out',
|
||||
pwd + '/results_test.dat']
|
||||
for f in output:
|
||||
if os.path.exists(f):
|
||||
os.remove(f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue