updated fixed_source test and added simple flux tally for comparison

This commit is contained in:
Bryan Herman 2013-08-12 15:05:02 -04:00
parent fa217cc6d0
commit bfbc929e66
4 changed files with 55 additions and 2 deletions

View file

@ -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)