mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Added test suite based on nosetests. Closes #27.
This commit is contained in:
parent
43ae900e7c
commit
358b7ca7bb
282 changed files with 15270 additions and 0 deletions
27
tests/test_plot_basis/test_plot_basis.py
Normal file
27
tests/test_plot_basis/test_plot_basis.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#!/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_plots_exists():
|
||||
assert os.path.exists(pwd + '/1_plot.ppm')
|
||||
assert os.path.exists(pwd + '/2_plot.ppm')
|
||||
assert os.path.exists(pwd + '/3_plot.ppm')
|
||||
|
||||
def teardown():
|
||||
output = [pwd + '/1_plot.ppm', pwd + '/2_plot.ppm', pwd + '/3_plot.ppm']
|
||||
for f in output:
|
||||
if os.path.exists(f):
|
||||
os.remove(f)
|
||||
Loading…
Add table
Add a link
Reference in a new issue