Fix test_particle_restart.

This commit is contained in:
Paul Romano 2013-06-16 16:10:38 -04:00
parent 4fee078e62
commit 8d8bb1f06c
4 changed files with 10 additions and 13 deletions

View file

@ -1,12 +1,9 @@
<?xml version="1.0"?>
<geometry>
<!-- Nested Cylinders with Tracking Error -->
<surface id="1" type="z-cylinder" coeffs="0.0 0.0 10.0" />
<surface id="2" type="z-cylinder" coeffs="0.0 0.0 20.0" boundary="reflective" />
<surface id="3" type="z-plane" coeffs="5.0" boundary="reflective" />
<surface id="4" type="z-plane" coeffs="-5.0" boundary="reflective" />
<cell id="1" material="1" surfaces="-1 3 -4" />
<cell id="2" material="1" surfaces="1 -2"/>
<!-- Sphere with no boundary condition -->
<surface id="1" type="sphere" coeffs="0.0 0.0 0.0 80.0" />
<surface id="2" type="sphere" coeffs="0.0 0.0 0.0 10000.0" boundary="vacuum" />
<cell id="1" material="1" surfaces="-1" />
</geometry>

View file

@ -2,7 +2,7 @@
<materials>
<material id="1">
<density value="4.5" units="g/cc" />
<density value="20.0" units="g/cc" />
<nuclide name="U-235" xs="70c" ao="1.0" />
</material>

View file

@ -9,7 +9,7 @@
<source>
<space type="box">
<parameters>-20 -20 -5 20 20 5</parameters>
<parameters>-10 -10 -5 10 10 5</parameters>
</space>
</source>

View file

@ -15,16 +15,16 @@ def test_run():
assert stderr != ''
def test_created_restart():
assert os.path.exists(pwd + '/particle_0.binary')
assert os.path.exists(pwd + '/particle_10_638.binary')
def test_run_restart():
proc = Popen([pwd + '/../../src/openmc -s particle_0.binary'],
proc = Popen([pwd + '/../../src/openmc -s particle_10_638.binary'],
stderr=PIPE, stdout=PIPE, shell=True)
stdout, stderr = proc.communicate()
assert stderr != ''
def teardown():
output = [pwd + '/particle_0.binary']
output = [pwd + '/particle_10_638.binary']
for f in output:
if os.path.exists(f):
os.remove(f)