mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -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
8
tests/test_plot_background/geometry.xml
Normal file
8
tests/test_plot_background/geometry.xml
Normal 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>
|
||||
9
tests/test_plot_background/materials.xml
Normal file
9
tests/test_plot_background/materials.xml
Normal 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>
|
||||
11
tests/test_plot_background/plots.xml
Normal file
11
tests/test_plot_background/plots.xml
Normal 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>
|
||||
16
tests/test_plot_background/settings.xml
Normal file
16
tests/test_plot_background/settings.xml
Normal 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>
|
||||
25
tests/test_plot_background/test_plot_background.py
Normal file
25
tests/test_plot_background/test_plot_background.py
Normal 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue