mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -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_statepoint_exists():
|
||||
statepoint = glob.glob(cwd + '/statepoint.*')
|
||||
statepoint = glob.glob(os.path.join(cwd, 'statepoint.*'))
|
||||
assert len(statepoint) == 5, '5 statepoint files must exist.'
|
||||
assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5'),\
|
||||
'Statepoint file detected that is not binary or hdf5.'
|
||||
|
||||
def test_results():
|
||||
statepoint = glob.glob(cwd + '/statepoint.8.*')
|
||||
statepoint = glob.glob(os.path.join(cwd, 'statepoint.8.*'))
|
||||
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 no agree.'
|
||||
|
||||
def teardown():
|
||||
output = glob.glob(cwd + '/statepoint.*')
|
||||
output.append(cwd + '/results_test.dat')
|
||||
output = glob.glob(os.path.join(cwd, 'statepoint.*'))
|
||||
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