Added test suite based on nosetests. Closes #27.

This commit is contained in:
Paul Romano 2013-02-01 15:22:32 -05:00
parent 43ae900e7c
commit 358b7ca7bb
282 changed files with 15270 additions and 0 deletions

View file

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<geometry>
<!-- Sphere with radius 10 -->
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
<cell id="1" material="1" surfaces="-1" />
</geometry>

View file

@ -0,0 +1,9 @@
<?xml version="1.0"?>
<materials>
<material id="1">
<density value="4.5" units="g/cc" />
<nuclide name="U-235" xs="70c" ao="1.0" />
</material>
</materials>

View file

@ -0,0 +1,11 @@
<?xml version="1.0"?>
<plots>
<plot id="1">
<origin>0. 0. 0.</origin>
<width>30. 30.</width>
<pixels>200 200</pixels>
<background>0 0 0</background>
</plot>
</plots>

View file

@ -0,0 +1,16 @@
<?xml version="1.0"?>
<settings>
<eigenvalue>
<batches>10</batches>
<inactive>5</inactive>
<particles>1000</particles>
</eigenvalue>
<source>
<space type="box">
<parameters>-4 -4 -4 4 4 4</parameters>
</space>
</source>
</settings>

View file

@ -0,0 +1,25 @@
#!/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)