diff --git a/tests/run_tests.py b/tests/run_tests.py index 5c48df3b9..74489feeb 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -144,7 +144,7 @@ class Test(object): if os.path.isfile(self.fc): result = True for path in os.environ["PATH"].split(":"): - if os.path.isfile(path + "/" + self.fc): + if os.path.isfile(os.path.join(path, self.fc)): result = True if not result: raise Exception("Compiler path '{0}' does not exist." diff --git a/tests/test_basic/test_basic.py b/tests/test_basic/test_basic.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_basic/test_basic.py +++ b/tests/test_basic/test_basic.py @@ -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) diff --git a/tests/test_cmfd_feed/test_cmfd_feed.py b/tests/test_cmfd_feed/test_cmfd_feed.py index 4bc2914e3..5610cfee4 100644 --- a/tests/test_cmfd_feed/test_cmfd_feed.py +++ b/tests/test_cmfd_feed/test_cmfd_feed.py @@ -24,18 +24,18 @@ def test_run(): assert returncode == 0, 'OpenMC did not exit successfully.' def test_created_statepoint(): - statepoint = glob.glob(cwd + '/statepoint.20.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.20.*')) 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' def test_results(): - statepoint = glob.glob(cwd + '/statepoint.20.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.20.*')) call(['python', 'results.py', statepoint[0]]) compare = filecmp.cmp('results_test.dat', 'results_true.dat') if not compare: @@ -44,9 +44,9 @@ def test_results(): def teardown(): - output = glob.glob(cwd + '/statepoint.20.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.20.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_cmfd_jfnk/test_cmfd_jfnk.py b/tests/test_cmfd_jfnk/test_cmfd_jfnk.py index 0fae02dfd..ec984a74b 100644 --- a/tests/test_cmfd_jfnk/test_cmfd_jfnk.py +++ b/tests/test_cmfd_jfnk/test_cmfd_jfnk.py @@ -25,18 +25,18 @@ def test_run(): def test_created_statepoint(): - statepoint = glob.glob(cwd + '/statepoint.20.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.20.*')) 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' def test_results(): - statepoint = glob.glob(cwd + '/statepoint.20.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.20.*')) call(['python', 'results.py', statepoint[0]]) compare = filecmp.cmp('results_test.dat', 'results_true.dat') if not compare: @@ -45,9 +45,9 @@ def test_results(): def teardown(): - output = glob.glob(cwd + '/statepoint.20.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.20.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_cmfd_nofeed/test_cmfd_nofeed.py b/tests/test_cmfd_nofeed/test_cmfd_nofeed.py index 0fae02dfd..ec984a74b 100644 --- a/tests/test_cmfd_nofeed/test_cmfd_nofeed.py +++ b/tests/test_cmfd_nofeed/test_cmfd_nofeed.py @@ -25,18 +25,18 @@ def test_run(): def test_created_statepoint(): - statepoint = glob.glob(cwd + '/statepoint.20.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.20.*')) 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' def test_results(): - statepoint = glob.glob(cwd + '/statepoint.20.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.20.*')) call(['python', 'results.py', statepoint[0]]) compare = filecmp.cmp('results_test.dat', 'results_true.dat') if not compare: @@ -45,9 +45,9 @@ def test_results(): def teardown(): - output = glob.glob(cwd + '/statepoint.20.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.20.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_confidence_intervals/test_confidence_intervals.py b/tests/test_confidence_intervals/test_confidence_intervals.py index 30c53738f..bf28e47d1 100644 --- a/tests/test_confidence_intervals/test_confidence_intervals.py +++ b/tests/test_confidence_intervals/test_confidence_intervals.py @@ -24,16 +24,16 @@ 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_created_output(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/results_test.dat') - output.append(cwd + '/tallies.out') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'results_test.dat')) + output.append(os.path.join(cwd,'tallies.out')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_density_atombcm/test_density_atombcm.py b/tests/test_density_atombcm/test_density_atombcm.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_density_atombcm/test_density_atombcm.py +++ b/tests/test_density_atombcm/test_density_atombcm.py @@ -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) diff --git a/tests/test_density_atomcm3/test_density_atomcm3.py b/tests/test_density_atomcm3/test_density_atomcm3.py index c74806269..9d1a7e567 100644 --- a/tests/test_density_atomcm3/test_density_atomcm3.py +++ b/tests/test_density_atomcm3/test_density_atomcm3.py @@ -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: @@ -39,7 +39,7 @@ def test_results(): def teardown(): output = glob.glob('statepoint.10.*') - output.append(cwd + '/results_test.dat') + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_density_kgm3/test_density_kgm3.py b/tests/test_density_kgm3/test_density_kgm3.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_density_kgm3/test_density_kgm3.py +++ b/tests/test_density_kgm3/test_density_kgm3.py @@ -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) diff --git a/tests/test_density_sum/test_density_sum.py b/tests/test_density_sum/test_density_sum.py index f4167d133..682cea7a4 100644 --- a/tests/test_density_sum/test_density_sum.py +++ b/tests/test_density_sum/test_density_sum.py @@ -24,7 +24,7 @@ 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.' @@ -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) diff --git a/tests/test_eigenvalue_genperbatch/test_eigenvalue_genperbatch.py b/tests/test_eigenvalue_genperbatch/test_eigenvalue_genperbatch.py index 453b1951f..de621617d 100644 --- a/tests/test_eigenvalue_genperbatch/test_eigenvalue_genperbatch.py +++ b/tests/test_eigenvalue_genperbatch/test_eigenvalue_genperbatch.py @@ -24,13 +24,13 @@ def test_run(): assert returncode == 0, 'OpenMC did not exit successfully.' def test_created_statepoint(): - statepoint = glob.glob(cwd + '/statepoint.7.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.7.*')) 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.7.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.7.*')) 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.7.*') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.7.*')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_eigenvalue_no_inactive/test_eigenvalue_no_inactive.py b/tests/test_eigenvalue_no_inactive/test_eigenvalue_no_inactive.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_eigenvalue_no_inactive/test_eigenvalue_no_inactive.py +++ b/tests/test_eigenvalue_no_inactive/test_eigenvalue_no_inactive.py @@ -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) diff --git a/tests/test_energy_grid/test_energy_grid.py b/tests/test_energy_grid/test_energy_grid.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_energy_grid/test_energy_grid.py +++ b/tests/test_energy_grid/test_energy_grid.py @@ -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) diff --git a/tests/test_entropy/test_entropy.py b/tests/test_entropy/test_entropy.py index 035a5c0ad..e68f948cd 100644 --- a/tests/test_entropy/test_entropy.py +++ b/tests/test_entropy/test_entropy.py @@ -25,13 +25,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: @@ -39,8 +39,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) diff --git a/tests/test_filter_cell/test_filter_cell.py b/tests/test_filter_cell/test_filter_cell.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_filter_cell/test_filter_cell.py +++ b/tests/test_filter_cell/test_filter_cell.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_filter_cellborn/test_filter_cellborn.py b/tests/test_filter_cellborn/test_filter_cellborn.py index 15f73ee35..fb1d801da 100644 --- a/tests/test_filter_cellborn/test_filter_cellborn.py +++ b/tests/test_filter_cellborn/test_filter_cellborn.py @@ -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.*')) def test_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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,9 +38,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_filter_energy/test_filter_energy.py b/tests/test_filter_energy/test_filter_energy.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_filter_energy/test_filter_energy.py +++ b/tests/test_filter_energy/test_filter_energy.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_filter_energyout/test_filter_energyout.py b/tests/test_filter_energyout/test_filter_energyout.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_filter_energyout/test_filter_energyout.py +++ b/tests/test_filter_energyout/test_filter_energyout.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_filter_group_transfer/test_filter_group_transfer.py b/tests/test_filter_group_transfer/test_filter_group_transfer.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_filter_group_transfer/test_filter_group_transfer.py +++ b/tests/test_filter_group_transfer/test_filter_group_transfer.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_filter_material/test_filter_material.py b/tests/test_filter_material/test_filter_material.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_filter_material/test_filter_material.py +++ b/tests/test_filter_material/test_filter_material.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_filter_mesh_2d/test_filter_mesh_2d.py b/tests/test_filter_mesh_2d/test_filter_mesh_2d.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_filter_mesh_2d/test_filter_mesh_2d.py +++ b/tests/test_filter_mesh_2d/test_filter_mesh_2d.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_filter_mesh_3d/test_filter_mesh_3d.py b/tests/test_filter_mesh_3d/test_filter_mesh_3d.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_filter_mesh_3d/test_filter_mesh_3d.py +++ b/tests/test_filter_mesh_3d/test_filter_mesh_3d.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_filter_universe/test_filter_universe.py b/tests/test_filter_universe/test_filter_universe.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_filter_universe/test_filter_universe.py +++ b/tests/test_filter_universe/test_filter_universe.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_fixed_source/test_fixed_source.py b/tests/test_fixed_source/test_fixed_source.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_fixed_source/test_fixed_source.py +++ b/tests/test_fixed_source/test_fixed_source.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_lattice/test_lattice.py b/tests/test_lattice/test_lattice.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_lattice/test_lattice.py +++ b/tests/test_lattice/test_lattice.py @@ -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) diff --git a/tests/test_lattice_multiple/test_lattice_multiple.py b/tests/test_lattice_multiple/test_lattice_multiple.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_lattice_multiple/test_lattice_multiple.py +++ b/tests/test_lattice_multiple/test_lattice_multiple.py @@ -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) diff --git a/tests/test_natural_element/test_natural_element.py b/tests/test_natural_element/test_natural_element.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_natural_element/test_natural_element.py +++ b/tests/test_natural_element/test_natural_element.py @@ -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) diff --git a/tests/test_output/test_output.py b/tests/test_output/test_output.py index b19e5d76d..30db431bc 100644 --- a/tests/test_output/test_output.py +++ b/tests/test_output/test_output.py @@ -24,23 +24,23 @@ def test_run(): assert returncode == 0, 'OpenMC did not exit successfully.' def test_summary_exists(): - summary = glob.glob(cwd + '/summary.*') + summary = glob.glob(os.path.join(cwd,'summary.*')) assert len(summary) == 1, 'Either multiple or no summary file exists.' assert summary[0].endswith('out') or summary[0].endswith('h5'),\ 'Summary file is not a binary or hdf5 file.' def test_cross_sections_exists(): - assert os.path.exists(cwd + '/cross_sections.out'),\ + assert os.path.exists(os.path.join(cwd, 'cross_sections.out')),\ 'Cross section output file does not exist.' def test_statepoint_exists(): - 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: @@ -48,10 +48,10 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') + glob.glob(cwd + '/summary.*') - output.append(cwd + '/summary.out') - output.append(cwd + '/cross_sections.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + glob.glob(os.path.join(cwd,'summary.*')) + output.append(os.path.join(cwd,'summary.out')) + output.append(os.path.join(cwd, 'cross_sections.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_particle_restart/test_particle_restart.py b/tests/test_particle_restart/test_particle_restart.py index 6c5dcf0be..c6d62a87d 100644 --- a/tests/test_particle_restart/test_particle_restart.py +++ b/tests/test_particle_restart/test_particle_restart.py @@ -24,13 +24,13 @@ def test_run(): assert returncode == 0, 'OpenMC did not exit successfully.' def test_created_restart(): - particle = glob.glob(cwd + '/particle_10_394.*') + particle = glob.glob(os.path.join(cwd, 'particle_10_394.*')) assert len(particle) == 1, 'Either multiple or no particle restart files exist.' assert particle[0].endswith('binary') or \ particle[0].endswith('h5'), 'Particle restart file not a binary or hdf5 file.' def test_results(): - particle = glob.glob(cwd + '/particle_10_394.*') + particle = glob.glob(os.path.join(cwd, 'particle_10_394.*')) call(['python', 'results.py', particle[0]]) compare = filecmp.cmp('results_test.dat', 'results_true.dat') if not compare: @@ -38,15 +38,15 @@ def test_results(): assert compare, 'Results do not agree.' def test_run_restart(): - particle = glob.glob(cwd + '/particle_10_394.*') + particle = glob.glob(os.path.join(cwd, 'particle_10_394.*')) proc = Popen([opts.exe, '-r', particle[0], cwd], stderr=PIPE, stdout=PIPE) stdout, stderr = proc.communicate() assert stderr == '', 'Particle restart not successful.' def teardown(): - output = glob.glob(cwd + '/statepoint.*') + \ - glob.glob(cwd + '/particle_*') + \ - [cwd + '/results_test.dat'] + output = glob.glob(os.path.join(cwd, 'statepoint.*')) + \ + glob.glob(os.path.join(cwd, 'particle_*')) + \ + [os.path.join(cwd,'results_test.dat')] for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_plot_background/test_plot_background.py b/tests/test_plot_background/test_plot_background.py index 4c990578a..7e5687a53 100644 --- a/tests/test_plot_background/test_plot_background.py +++ b/tests/test_plot_background/test_plot_background.py @@ -22,10 +22,10 @@ def test_run(): assert returncode == 0, 'OpenMC did not exit successfully.' def test_plot_exists(): - assert os.path.exists(cwd + '/1_plot.ppm'), 'Plot ppm file does not exist.' + assert os.path.exists(os.path.join(cwd ,'1_plot.ppm')), 'Plot ppm file does not exist.' def teardown(): - output = [cwd + '/1_plot.ppm'] + output = [os.path.join(cwd ,'1_plot.ppm')] for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_plot_basis/test_plot_basis.py b/tests/test_plot_basis/test_plot_basis.py index 057fd09a9..94c2ace26 100644 --- a/tests/test_plot_basis/test_plot_basis.py +++ b/tests/test_plot_basis/test_plot_basis.py @@ -22,12 +22,12 @@ def test_run(): assert returncode == 0, 'OpenMC did not exit successfully.' def test_plots_exists(): - assert os.path.exists(cwd + '/1_plot.ppm'), 'Plot 1 result does not exist.' - assert os.path.exists(cwd + '/2_plot.ppm'), 'Plot 2 result does not exist.' - assert os.path.exists(cwd + '/3_plot.ppm'), 'Plot 3 result does not exist.' + assert os.path.exists(os.path.join(cwd ,'1_plot.ppm')), 'Plot 1 result does not exist.' + assert os.path.exists(os.path.join(cwd ,'2_plot.ppm')), 'Plot 2 result does not exist.' + assert os.path.exists(os.path.join(cwd ,'3_plot.ppm')), 'Plot 3 result does not exist.' def teardown(): - output = [cwd + '/1_plot.ppm', cwd + '/2_plot.ppm', cwd + '/3_plot.ppm'] + output = [os.path.join(cwd ,'1_plot.ppm'), os.path.join(cwd ,'2_plot.ppm'), os.path.join(cwd ,'3_plot.ppm')] for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_plot_colspec/test_plot_colspec.py b/tests/test_plot_colspec/test_plot_colspec.py index 4c990578a..7e5687a53 100644 --- a/tests/test_plot_colspec/test_plot_colspec.py +++ b/tests/test_plot_colspec/test_plot_colspec.py @@ -22,10 +22,10 @@ def test_run(): assert returncode == 0, 'OpenMC did not exit successfully.' def test_plot_exists(): - assert os.path.exists(cwd + '/1_plot.ppm'), 'Plot ppm file does not exist.' + assert os.path.exists(os.path.join(cwd ,'1_plot.ppm')), 'Plot ppm file does not exist.' def teardown(): - output = [cwd + '/1_plot.ppm'] + output = [os.path.join(cwd ,'1_plot.ppm')] for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_plot_mask/test_plot_mask.py b/tests/test_plot_mask/test_plot_mask.py index 057fd09a9..94c2ace26 100644 --- a/tests/test_plot_mask/test_plot_mask.py +++ b/tests/test_plot_mask/test_plot_mask.py @@ -22,12 +22,12 @@ def test_run(): assert returncode == 0, 'OpenMC did not exit successfully.' def test_plots_exists(): - assert os.path.exists(cwd + '/1_plot.ppm'), 'Plot 1 result does not exist.' - assert os.path.exists(cwd + '/2_plot.ppm'), 'Plot 2 result does not exist.' - assert os.path.exists(cwd + '/3_plot.ppm'), 'Plot 3 result does not exist.' + assert os.path.exists(os.path.join(cwd ,'1_plot.ppm')), 'Plot 1 result does not exist.' + assert os.path.exists(os.path.join(cwd ,'2_plot.ppm')), 'Plot 2 result does not exist.' + assert os.path.exists(os.path.join(cwd ,'3_plot.ppm')), 'Plot 3 result does not exist.' def teardown(): - output = [cwd + '/1_plot.ppm', cwd + '/2_plot.ppm', cwd + '/3_plot.ppm'] + output = [os.path.join(cwd ,'1_plot.ppm'), os.path.join(cwd ,'2_plot.ppm'), os.path.join(cwd ,'3_plot.ppm')] for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_ptables_off/test_ptables_off.py b/tests/test_ptables_off/test_ptables_off.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_ptables_off/test_ptables_off.py +++ b/tests/test_ptables_off/test_ptables_off.py @@ -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) diff --git a/tests/test_reflective_cone/test_reflective_cone.py b/tests/test_reflective_cone/test_reflective_cone.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_reflective_cone/test_reflective_cone.py +++ b/tests/test_reflective_cone/test_reflective_cone.py @@ -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) diff --git a/tests/test_reflective_cylinder/test_reflective_cylinder.py b/tests/test_reflective_cylinder/test_reflective_cylinder.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_reflective_cylinder/test_reflective_cylinder.py +++ b/tests/test_reflective_cylinder/test_reflective_cylinder.py @@ -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) diff --git a/tests/test_reflective_plane/test_reflective_plane.py b/tests/test_reflective_plane/test_reflective_plane.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_reflective_plane/test_reflective_plane.py +++ b/tests/test_reflective_plane/test_reflective_plane.py @@ -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) diff --git a/tests/test_reflective_sphere/test_reflective_sphere.py b/tests/test_reflective_sphere/test_reflective_sphere.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_reflective_sphere/test_reflective_sphere.py +++ b/tests/test_reflective_sphere/test_reflective_sphere.py @@ -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) diff --git a/tests/test_rotation/test_rotation.py b/tests/test_rotation/test_rotation.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_rotation/test_rotation.py +++ b/tests/test_rotation/test_rotation.py @@ -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) diff --git a/tests/test_salphabeta/test_salphabeta.py b/tests/test_salphabeta/test_salphabeta.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_salphabeta/test_salphabeta.py +++ b/tests/test_salphabeta/test_salphabeta.py @@ -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) diff --git a/tests/test_salphabeta_multiple/test_salphabeta_multiple.py b/tests/test_salphabeta_multiple/test_salphabeta_multiple.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_salphabeta_multiple/test_salphabeta_multiple.py +++ b/tests/test_salphabeta_multiple/test_salphabeta_multiple.py @@ -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) diff --git a/tests/test_score_MT/test_score_MT.py b/tests/test_score_MT/test_score_MT.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_score_MT/test_score_MT.py +++ b/tests/test_score_MT/test_score_MT.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_score_absorption/test_score_absorption.py b/tests/test_score_absorption/test_score_absorption.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_score_absorption/test_score_absorption.py +++ b/tests/test_score_absorption/test_score_absorption.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_score_current/test_score_current.py b/tests/test_score_current/test_score_current.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_score_current/test_score_current.py +++ b/tests/test_score_current/test_score_current.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_score_events/test_score_events.py b/tests/test_score_events/test_score_events.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_score_events/test_score_events.py +++ b/tests/test_score_events/test_score_events.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_score_fission/test_score_fission.py b/tests/test_score_fission/test_score_fission.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_score_fission/test_score_fission.py +++ b/tests/test_score_fission/test_score_fission.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_score_flux/test_score_flux.py b/tests/test_score_flux/test_score_flux.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_score_flux/test_score_flux.py +++ b/tests/test_score_flux/test_score_flux.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_score_kappafission/test_score_kappafission.py b/tests/test_score_kappafission/test_score_kappafission.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_score_kappafission/test_score_kappafission.py +++ b/tests/test_score_kappafission/test_score_kappafission.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_score_nufission/test_score_nufission.py b/tests/test_score_nufission/test_score_nufission.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_score_nufission/test_score_nufission.py +++ b/tests/test_score_nufission/test_score_nufission.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_score_nuscatter/test_score_nuscatter.py b/tests/test_score_nuscatter/test_score_nuscatter.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_score_nuscatter/test_score_nuscatter.py +++ b/tests/test_score_nuscatter/test_score_nuscatter.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_score_scatter/test_score_scatter.py b/tests/test_score_scatter/test_score_scatter.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_score_scatter/test_score_scatter.py +++ b/tests/test_score_scatter/test_score_scatter.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_score_scatter_n/test_score_scatter_n.py b/tests/test_score_scatter_n/test_score_scatter_n.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_score_scatter_n/test_score_scatter_n.py +++ b/tests/test_score_scatter_n/test_score_scatter_n.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_score_scatter_pn/test_score_scatter_pn.py b/tests/test_score_scatter_pn/test_score_scatter_pn.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_score_scatter_pn/test_score_scatter_pn.py +++ b/tests/test_score_scatter_pn/test_score_scatter_pn.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_score_total/test_score_total.py b/tests/test_score_total/test_score_total.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_score_total/test_score_total.py +++ b/tests/test_score_total/test_score_total.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_seed/test_seed.py b/tests/test_seed/test_seed.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_seed/test_seed.py +++ b/tests/test_seed/test_seed.py @@ -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) diff --git a/tests/test_source_angle_mono/test_source_angle_mono.py b/tests/test_source_angle_mono/test_source_angle_mono.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_source_angle_mono/test_source_angle_mono.py +++ b/tests/test_source_angle_mono/test_source_angle_mono.py @@ -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) diff --git a/tests/test_source_energy_maxwell/test_source_energy_maxwell.py b/tests/test_source_energy_maxwell/test_source_energy_maxwell.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_source_energy_maxwell/test_source_energy_maxwell.py +++ b/tests/test_source_energy_maxwell/test_source_energy_maxwell.py @@ -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) diff --git a/tests/test_source_energy_mono/test_source_energy_mono.py b/tests/test_source_energy_mono/test_source_energy_mono.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_source_energy_mono/test_source_energy_mono.py +++ b/tests/test_source_energy_mono/test_source_energy_mono.py @@ -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) diff --git a/tests/test_source_file/test_source_file.py b/tests/test_source_file/test_source_file.py index 1be4b92cf..af1f2f5be 100644 --- a/tests/test_source_file/test_source_file.py +++ b/tests/test_source_file/test_source_file.py @@ -61,18 +61,18 @@ def test_run1(): assert returncode == 0, 'OpenMC did not exit successfully.' def test_statepoint_exists(): - 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.' - source = glob.glob(cwd + '/source.10.*') + source = glob.glob(os.path.join(cwd,'source.10.*')) assert len(statepoint) == 1, 'Either multple or no source files exist.' assert source[0].endswith('binary') or source[0].endswith('h5'),\ 'Source file is not a binary or hdf5 file.' def test_run2(): - openmc_path = cwd + '/../../src/openmc' - source = glob.glob(cwd + '/source.10.*') + openmc_path = os.path.join(cwd, '../../src/openmc') + source = glob.glob(os.path.join(cwd,'source.10.*')) with open('settings.xml','w') as fh: fh.write(settings2.format(source[0].split('.')[2])) if opts.mpi_exec != '': @@ -85,7 +85,7 @@ def test_run2(): assert returncode == 0, 'OpenMC did not exit successfully.' 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: @@ -95,9 +95,9 @@ def test_results(): def teardown(): with open('settings.xml','w') as fh: fh.write(settings1) - output = glob.glob(cwd + '/statepoint.10.*') - output += glob.glob(cwd + '/source.10.*') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output += glob.glob(os.path.join(cwd,'source.10.*')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_source_point/test_source_point.py b/tests/test_source_point/test_source_point.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_source_point/test_source_point.py +++ b/tests/test_source_point/test_source_point.py @@ -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) diff --git a/tests/test_sourcepoint_batch/test_sourcepoint_batch.py b/tests/test_sourcepoint_batch/test_sourcepoint_batch.py index e7fd49b40..a6805922f 100644 --- a/tests/test_sourcepoint_batch/test_sourcepoint_batch.py +++ b/tests/test_sourcepoint_batch/test_sourcepoint_batch.py @@ -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) diff --git a/tests/test_sourcepoint_interval/test_sourcepoint_interval.py b/tests/test_sourcepoint_interval/test_sourcepoint_interval.py index d59b5261d..f0e4d2754 100644 --- a/tests/test_sourcepoint_interval/test_sourcepoint_interval.py +++ b/tests/test_sourcepoint_interval/test_sourcepoint_interval.py @@ -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 not 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) diff --git a/tests/test_sourcepoint_latest/test_sourcepoint_latest.py b/tests/test_sourcepoint_latest/test_sourcepoint_latest.py index 858656e83..84791251b 100644 --- a/tests/test_sourcepoint_latest/test_sourcepoint_latest.py +++ b/tests/test_sourcepoint_latest/test_sourcepoint_latest.py @@ -24,17 +24,17 @@ def test_run(): assert returncode == 0, 'OpenMC did not exit successfully.' def test_statepoint_exists(): - statepoint = glob.glob(cwd + '/statepoint.10.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.10.*')) assert len(statepoint) == 1, 'Either multiple or no statepoint file exists.' assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5'),\ 'Statepoint file is not a binary or hdf5 file.' - source = glob.glob(cwd + '/source.*') + source = glob.glob(os.path.join(cwd,'source.*')) assert len(source) == 1, 'Either multple or no source file exists.' assert source[0].endswith('binary') or source[0].endswith('h5'),\ 'Source 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: @@ -42,9 +42,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output += glob.glob(cwd + '/source.*') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output += glob.glob(os.path.join(cwd,'source.*')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_sourcepoint_restart/test_sourcepoint_restart.py b/tests/test_sourcepoint_restart/test_sourcepoint_restart.py index 81b16255f..8f2cf64c1 100644 --- a/tests/test_sourcepoint_restart/test_sourcepoint_restart.py +++ b/tests/test_sourcepoint_restart/test_sourcepoint_restart.py @@ -24,17 +24,17 @@ def test_run(): assert returncode == 0, 'OpenMC did not exit successfully.' def test_created_statepoint(): - statepoint = glob.glob(cwd + '/statepoint.*') + statepoint = glob.glob(os.path.join(cwd, 'statepoint.*')) assert len(statepoint) == 2, '2 statepoint files must exist.' assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5'),\ 'Statepoint file must either be binary or hdf5.' - sourcepoint = glob.glob(cwd + '/source.7.*') + sourcepoint = glob.glob(os.path.join(cwd,'source.7.*')) assert len(sourcepoint) == 1, 'Either multiple or no source files found.' assert sourcepoint[0].endswith('binary') or sourcepoint[0].endswith('h5'),\ 'Source file must either be binary or hdf5.' 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: @@ -43,8 +43,8 @@ def test_results(): os.remove(statepoint[0]) def test_restart_form1(): - statepoint = glob.glob(cwd + '/statepoint.7.*') - sourcepoint = glob.glob(cwd + '/source.7.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.7.*')) + sourcepoint = glob.glob(os.path.join(cwd,'source.7.*')) if opts.mpi_exec != '': proc = Popen([opts.mpi_exec, '-np', opts.mpi_np, opts.exe, '-r', statepoint[0], sourcepoint[0], cwd], stderr=STDOUT, stdout=PIPE) @@ -55,13 +55,13 @@ def test_restart_form1(): assert returncode == 0, 'OpenMC restart 1 did not exit successfully.' def test_created_statepoint_form1(): - statepoint = glob.glob(cwd + '/statepoint.10.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.10.*')) assert len(statepoint) == 1, 'Batch 10 statepoint file does not exist.' assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5'),\ 'Statepoint file must be a binary or hdf5 file.' def test_results_form1(): - 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: @@ -70,8 +70,8 @@ def test_results_form1(): os.remove(statepoint[0]) def test_restart_form2(): - statepoint = glob.glob(cwd + '/statepoint.7.*') - sourcepoint = glob.glob(cwd + '/source.7.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.7.*')) + sourcepoint = glob.glob(os.path.join(cwd,'source.7.*')) if opts.mpi_exec != '': proc = Popen([opts.mpi_exec, '-np', opts.mpi_np, opts.exe, '--restart', statepoint[0], sourcepoint[0], cwd], stderr=STDOUT, stdout=PIPE) @@ -82,13 +82,13 @@ def test_restart_form2(): assert returncode == 0, 'OpenMC restart 2 did not exit successfully.' def test_created_statepoint_form2(): - statepoint = glob.glob(cwd + '/statepoint.10.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.10.*')) assert len(statepoint) == 1, 'Batch 10 statepoint file does not exist.' assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5'),\ 'Statepoint file not a binary or hdf5 file.' def test_results_form2(): - 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: @@ -97,21 +97,21 @@ def test_results_form2(): os.remove(statepoint[0]) def test_restart_serial(): - statepoint = glob.glob(cwd + '/statepoint.7.*') - sourcepoint = glob.glob(cwd + '/source.7.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.7.*')) + sourcepoint = glob.glob(os.path.join(cwd,'source.7.*')) proc = Popen([opts.exe, '--restart', statepoint[0], sourcepoint[0], cwd], stderr=STDOUT, stdout=PIPE) print(proc.communicate()[0]) returncode = proc.returncode assert returncode == 0, 'OpenMC restart serial did not exit successfully.' def test_created_statepoint_serial(): - statepoint = glob.glob(cwd + '/statepoint.10.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.10.*')) assert len(statepoint) == 1, 'Batch 10 statepoint file does not exist.' assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5'),\ 'Statepoint file is not a binary or hdf5 file.' def test_results_serial(): - 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: @@ -119,9 +119,9 @@ def test_results_serial(): assert compare, 'Serial results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.*') - output += glob.glob(cwd + '/source.*') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd, 'statepoint.*')) + output += glob.glob(os.path.join(cwd,'source.*')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_statepoint_batch/test_statepoint_batch.py b/tests/test_statepoint_batch/test_statepoint_batch.py index ea3993d10..add836462 100644 --- a/tests/test_statepoint_batch/test_statepoint_batch.py +++ b/tests/test_statepoint_batch/test_statepoint_batch.py @@ -24,21 +24,21 @@ def test_run(): assert returncode == 0, 'OpenMC did not exit successfully.' def test_statepoints_exist(): - statepoint = glob.glob(cwd + '/statepoint.3.*') + statepoint = glob.glob(os.path.join(cwd, 'statepoint.3.*')) assert len(statepoint) == 1, 'Either multiple or no statepoint.3 files exist.' assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5'),\ 'Statepoint.3 file is not a binary or hdf5 file.' - statepoint = glob.glob(cwd + '/statepoint.6.*') + statepoint = glob.glob(os.path.join(cwd, 'statepoint.6.*')) assert len(statepoint) == 1, 'Either multiple or no statepoint.6 files exist.' assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5'),\ 'Statepoint.6 file is not a binary or hdf5 file.' - statepoint = glob.glob(cwd + '/statepoint.9.*') + statepoint = glob.glob(os.path.join(cwd, 'statepoint.9.*')) assert len(statepoint) == 1, 'Either multiple or no statepoint.9 files exist.' assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5'),\ 'Statepoint.9 file is not a binary or hdf5 file.' def test_results(): - statepoint = glob.glob(cwd + '/statepoint.9.*') + statepoint = glob.glob(os.path.join(cwd, 'statepoint.9.*')) call(['python', 'results.py', statepoint[0]]) compare = filecmp.cmp('results_test.dat', 'results_true.dat') if not compare: @@ -46,8 +46,8 @@ def test_results(): assert compare, 'Results do not 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) diff --git a/tests/test_statepoint_interval/test_statepoint_interval.py b/tests/test_statepoint_interval/test_statepoint_interval.py index f80cc2dca..48427fa5c 100644 --- a/tests/test_statepoint_interval/test_statepoint_interval.py +++ b/tests/test_statepoint_interval/test_statepoint_interval.py @@ -25,29 +25,29 @@ def test_run(): assert returncode == 0, 'OpenMC did not exit successfully.' def test_statepoints_exist(): - statepoint = glob.glob(cwd + '/statepoint.2.*') + statepoint = glob.glob(os.path.join(cwd, 'statepoint.2.*')) assert len(statepoint) == 1, 'Either multiple or no statepoint.2 files exist.' assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5'),\ 'Statepoint.2 file is not a binary or hdf5 file.' - statepoint = glob.glob(cwd + '/statepoint.4.*') + statepoint = glob.glob(os.path.join(cwd, 'statepoint.4.*')) assert len(statepoint) == 1, 'Either multiple or no statepoint.4 files exist.' assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5'),\ 'Statepoint.4 file is not a binary or hdf5 file.' - statepoint = glob.glob(cwd + '/statepoint.6.*') + statepoint = glob.glob(os.path.join(cwd, 'statepoint.6.*')) assert len(statepoint) == 1, 'Either multiple or no statepoint.6 files exist.' assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5'),\ 'Statepoint.6 file is not a binary or hdf5 file.' - statepoint = glob.glob(cwd + '/statepoint.8.*') + statepoint = glob.glob(os.path.join(cwd, 'statepoint.8.*')) assert len(statepoint) == 1, 'Either multiple or no statepoint.8 files exist.' assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5'),\ 'Statepoint.8 file is not a binary or hdf5 file.' - statepoint = glob.glob(cwd + '/statepoint.10.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.10.*')) assert len(statepoint) == 1, 'Either multiple or no statepoint.10 files exist.' assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5'),\ 'Statepoint.10 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: @@ -55,8 +55,8 @@ def test_results(): assert compare, 'Results do not 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) diff --git a/tests/test_statepoint_restart/test_statepoint_restart.py b/tests/test_statepoint_restart/test_statepoint_restart.py index 06b982917..8bb0eec05 100644 --- a/tests/test_statepoint_restart/test_statepoint_restart.py +++ b/tests/test_statepoint_restart/test_statepoint_restart.py @@ -24,13 +24,13 @@ def test_run(): assert returncode == 0, 'OpenMC did not exit successfully.' def test_created_statepoint(): - statepoint = glob.glob(cwd + '/statepoint.7.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.7.*')) 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.7.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.7.*')) call(['python', 'results.py', statepoint[0]]) compare = filecmp.cmp('results_test.dat', 'results_true.dat') if not compare: @@ -38,7 +38,7 @@ def test_results(): assert compare, 'Initial test results do not agree.' def test_restart_form1(): - statepoint = glob.glob(cwd + '/statepoint.7.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.7.*')) if opts.mpi_exec != '': proc = Popen([opts.mpi_exec, '-np', opts.mpi_np, opts.exe, '-r', statepoint[0], cwd], stderr=STDOUT, stdout=PIPE) @@ -49,13 +49,13 @@ def test_restart_form1(): assert returncode == 0, 'OpenMC restart 1 did not exit successfully.' def test_created_statepoint_form1(): - statepoint = glob.glob(cwd + '/statepoint.7.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.7.*')) 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_form1(): - statepoint = glob.glob(cwd + '/statepoint.7.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.7.*')) call(['python', 'results.py', statepoint[0]]) compare = filecmp.cmp('results_test.dat', 'results_true.dat') if not compare: @@ -63,7 +63,7 @@ def test_results_form1(): assert compare, 'Restart 1 test results do not agree.' def test_restart_form2(): - statepoint = glob.glob(cwd + '/statepoint.7.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.7.*')) if opts.mpi_exec != '': proc = Popen([opts.mpi_exec, '-np', opts.mpi_np, opts.exe, '--restart', statepoint[0], cwd], stderr=STDOUT, stdout=PIPE) @@ -74,13 +74,13 @@ def test_restart_form2(): assert returncode == 0, 'OpenMC restart 2 did not exit successfully.' def test_created_statepoint_form2(): - statepoint = glob.glob(cwd + '/statepoint.7.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.7.*')) 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_form2(): - statepoint = glob.glob(cwd + '/statepoint.7.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.7.*')) call(['python', 'results.py', statepoint[0]]) compare = filecmp.cmp('results_test.dat', 'results_true.dat') if not compare: @@ -88,20 +88,20 @@ def test_results_form2(): assert compare, 'Restart 2 test results do not agree.' def test_restart_serial(): - statepoint = glob.glob(cwd + '/statepoint.7.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.7.*')) proc = Popen([opts.exe, '--restart', statepoint[0], cwd], stderr=STDOUT, stdout=PIPE) print(proc.communicate()[0]) returncode = proc.returncode assert returncode == 0, 'OpenMC restart serial did not exit successfully.' def test_created_statepoint_serial(): - statepoint = glob.glob(cwd + '/statepoint.7.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.7.*')) 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_serial(): - statepoint = glob.glob(cwd + '/statepoint.7.*') + statepoint = glob.glob(os.path.join(cwd,'statepoint.7.*')) call(['python', 'results.py', statepoint[0]]) compare = filecmp.cmp('results_test.dat', 'results_true.dat') if not compare: @@ -109,8 +109,8 @@ def test_results_serial(): assert compare, 'Restart serial test results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.7.*') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.7.*')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_statepoint_sourcesep/test_statepoint_sourcesep.py b/tests/test_statepoint_sourcesep/test_statepoint_sourcesep.py index 00e70444d..7329c9cee 100644 --- a/tests/test_statepoint_sourcesep/test_statepoint_sourcesep.py +++ b/tests/test_statepoint_sourcesep/test_statepoint_sourcesep.py @@ -24,17 +24,17 @@ def test_run(): assert returncode == 0, 'OpenMC did not exit successfully.' def test_statepoint_exists(): - 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.' - source = glob.glob(cwd + '/source.10.*') + source = glob.glob(os.path.join(cwd,'source.10.*')) assert len(source) == 1, 'Either multiple or no source files exist.' assert source[0].endswith('binary') or source[0].endswith('h5'),\ 'Source 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: @@ -42,9 +42,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output += glob.glob(cwd + '/source.10.*') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output += glob.glob(os.path.join(cwd,'source.10.*')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_survival_biasing/test_survival_biasing.py b/tests/test_survival_biasing/test_survival_biasing.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_survival_biasing/test_survival_biasing.py +++ b/tests/test_survival_biasing/test_survival_biasing.py @@ -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) diff --git a/tests/test_tally_assumesep/test_tally_assumesep.py b/tests/test_tally_assumesep/test_tally_assumesep.py index f2068f85f..a5aeeb683 100644 --- a/tests/test_tally_assumesep/test_tally_assumesep.py +++ b/tests/test_tally_assumesep/test_tally_assumesep.py @@ -24,16 +24,16 @@ 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_output_exists(): - assert os.path.exists(cwd + '/tallies.out'), 'Tally output file does not exist.' + assert os.path.exists(os.path.join(cwd,'tallies.out')), 'Tally output file does not exist.' 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: @@ -41,9 +41,9 @@ def test_results(): assert compare, 'Results do not agree.' def teardown(): - output = glob.glob(cwd + '/statepoint.10.*') - output.append(cwd + '/tallies.out') - output.append(cwd + '/results_test.dat') + output = glob.glob(os.path.join(cwd,'statepoint.10.*')) + output.append(os.path.join(cwd,'tallies.out')) + output.append(os.path.join(cwd,'results_test.dat')) for f in output: if os.path.exists(f): os.remove(f) diff --git a/tests/test_trace/test_trace.py b/tests/test_trace/test_trace.py index dae89b62b..658cf1299 100644 --- a/tests/test_trace/test_trace.py +++ b/tests/test_trace/test_trace.py @@ -26,13 +26,13 @@ def test_run(): assert stdout.find('Simulating Particle 453') != -1 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: @@ -40,8 +40,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) diff --git a/tests/test_translation/test_translation.py b/tests/test_translation/test_translation.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_translation/test_translation.py +++ b/tests/test_translation/test_translation.py @@ -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) diff --git a/tests/test_uniform_fs/test_uniform_fs.py b/tests/test_uniform_fs/test_uniform_fs.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_uniform_fs/test_uniform_fs.py +++ b/tests/test_uniform_fs/test_uniform_fs.py @@ -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) diff --git a/tests/test_universe/test_universe.py b/tests/test_universe/test_universe.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_universe/test_universe.py +++ b/tests/test_universe/test_universe.py @@ -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) diff --git a/tests/test_void/test_void.py b/tests/test_void/test_void.py index ef2dceed8..0be8e10b0 100644 --- a/tests/test_void/test_void.py +++ b/tests/test_void/test_void.py @@ -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)