OpenMC/tests/test_plot_colspec/test_plot_colspec.py
2013-02-01 15:22:32 -05:00

25 lines
554 B
Python

#!/usr/bin/env python
import os
from subprocess import Popen, STDOUT, PIPE
pwd = os.path.dirname(__file__)
def setup():
os.putenv('PWD', pwd)
os.chdir(pwd)
def test_run():
proc = Popen([pwd + '/../../src/openmc', '-p'], stderr=STDOUT, stdout=PIPE)
returncode = proc.wait()
print(proc.communicate()[0])
assert returncode == 0
def test_plot_exists():
assert os.path.exists(pwd + '/1_plot.ppm')
def teardown():
output = [pwd + '/1_plot.ppm']
for f in output:
if os.path.exists(f):
os.remove(f)