mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
using os.path.join to join paths instead of string concatenation
This commit is contained in:
parent
3ad1bd2f20
commit
92dce0b83b
75 changed files with 390 additions and 390 deletions
|
|
@ -24,13 +24,13 @@ def test_run():
|
|||
assert returncode == 0, 'OpenMC did not exit successfully.'
|
||||
|
||||
def test_created_statepoint():
|
||||
statepoint = glob.glob(cwd + '/statepoint.10.*')
|
||||
statepoint = glob.glob(os.path.join(cwd,'statepoint.10.*'))
|
||||
assert len(statepoint) == 1, 'Either multiple or no statepoint files exist.'
|
||||
assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5'),\
|
||||
'Statepoint file is not a binary or hdf5 file.'
|
||||
|
||||
def test_results():
|
||||
statepoint = glob.glob(cwd + '/statepoint.10.*')
|
||||
statepoint = glob.glob(os.path.join(cwd,'statepoint.10.*'))
|
||||
call(['python', 'results.py', statepoint[0]])
|
||||
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
|
||||
if not compare:
|
||||
|
|
@ -38,8 +38,8 @@ def test_results():
|
|||
assert compare, 'Results do not agree.'
|
||||
|
||||
def teardown():
|
||||
output = glob.glob(cwd + '/statepoint.10.*')
|
||||
output.append(cwd + '/results_test.dat')
|
||||
output = glob.glob(os.path.join(cwd,'statepoint.10.*'))
|
||||
output.append(os.path.join(cwd,'results_test.dat'))
|
||||
for f in output:
|
||||
if os.path.exists(f):
|
||||
os.remove(f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue