From 92dce0b83b5bfba1fd341f36a0935520cc921eb9 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Tue, 8 Apr 2014 18:19:44 -0400 Subject: [PATCH 1/5] using os.path.join to join paths instead of string concatenation --- tests/run_tests.py | 2 +- tests/test_basic/test_basic.py | 8 ++--- tests/test_cmfd_feed/test_cmfd_feed.py | 12 +++---- tests/test_cmfd_jfnk/test_cmfd_jfnk.py | 12 +++---- tests/test_cmfd_nofeed/test_cmfd_nofeed.py | 12 +++---- .../test_confidence_intervals.py | 12 +++---- .../test_density_atombcm.py | 8 ++--- .../test_density_atomcm3.py | 6 ++-- tests/test_density_kgm3/test_density_kgm3.py | 8 ++--- tests/test_density_sum/test_density_sum.py | 6 ++-- .../test_eigenvalue_genperbatch.py | 8 ++--- .../test_eigenvalue_no_inactive.py | 8 ++--- tests/test_energy_grid/test_energy_grid.py | 8 ++--- tests/test_entropy/test_entropy.py | 8 ++--- tests/test_filter_cell/test_filter_cell.py | 12 +++---- .../test_filter_cellborn.py | 12 +++---- .../test_filter_energy/test_filter_energy.py | 12 +++---- .../test_filter_energyout.py | 12 +++---- .../test_filter_group_transfer.py | 12 +++---- .../test_filter_material.py | 12 +++---- .../test_filter_mesh_2d.py | 12 +++---- .../test_filter_mesh_3d.py | 12 +++---- .../test_filter_universe.py | 12 +++---- tests/test_fixed_source/test_fixed_source.py | 12 +++---- tests/test_lattice/test_lattice.py | 8 ++--- .../test_lattice_multiple.py | 8 ++--- .../test_natural_element.py | 8 ++--- tests/test_output/test_output.py | 16 ++++----- .../test_particle_restart.py | 12 +++---- .../test_plot_background.py | 4 +-- tests/test_plot_basis/test_plot_basis.py | 8 ++--- tests/test_plot_colspec/test_plot_colspec.py | 4 +-- tests/test_plot_mask/test_plot_mask.py | 8 ++--- tests/test_ptables_off/test_ptables_off.py | 8 ++--- .../test_reflective_cone.py | 8 ++--- .../test_reflective_cylinder.py | 8 ++--- .../test_reflective_plane.py | 8 ++--- .../test_reflective_sphere.py | 8 ++--- tests/test_rotation/test_rotation.py | 8 ++--- tests/test_salphabeta/test_salphabeta.py | 8 ++--- .../test_salphabeta_multiple.py | 8 ++--- tests/test_score_MT/test_score_MT.py | 12 +++---- .../test_score_absorption.py | 12 +++---- .../test_score_current/test_score_current.py | 12 +++---- tests/test_score_events/test_score_events.py | 12 +++---- .../test_score_fission/test_score_fission.py | 12 +++---- tests/test_score_flux/test_score_flux.py | 12 +++---- .../test_score_kappafission.py | 12 +++---- .../test_score_nufission.py | 12 +++---- .../test_score_nuscatter.py | 12 +++---- .../test_score_scatter/test_score_scatter.py | 12 +++---- .../test_score_scatter_n.py | 12 +++---- .../test_score_scatter_pn.py | 12 +++---- tests/test_score_total/test_score_total.py | 12 +++---- tests/test_seed/test_seed.py | 8 ++--- .../test_source_angle_mono.py | 8 ++--- .../test_source_energy_maxwell.py | 8 ++--- .../test_source_energy_mono.py | 8 ++--- tests/test_source_file/test_source_file.py | 16 ++++----- tests/test_source_point/test_source_point.py | 8 ++--- .../test_sourcepoint_batch.py | 8 ++--- .../test_sourcepoint_interval.py | 8 ++--- .../test_sourcepoint_latest.py | 12 +++---- .../test_sourcepoint_restart.py | 36 +++++++++---------- .../test_statepoint_batch.py | 12 +++---- .../test_statepoint_interval.py | 16 ++++----- .../test_statepoint_restart.py | 26 +++++++------- .../test_statepoint_sourcesep.py | 12 +++---- .../test_survival_biasing.py | 8 ++--- .../test_tally_assumesep.py | 12 +++---- tests/test_trace/test_trace.py | 8 ++--- tests/test_translation/test_translation.py | 8 ++--- tests/test_uniform_fs/test_uniform_fs.py | 8 ++--- tests/test_universe/test_universe.py | 8 ++--- tests/test_void/test_void.py | 8 ++--- 75 files changed, 390 insertions(+), 390 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 5c48df3b90..74489feeb1 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 ef2dceed89..0be8e10b07 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 4bc2914e3a..5610cfee4f 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 0fae02dfdb..ec984a74b3 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 0fae02dfdb..ec984a74b3 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 30c53738fb..bf28e47d1e 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 ef2dceed89..0be8e10b07 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 c748062691..9d1a7e5671 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 ef2dceed89..0be8e10b07 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 f4167d1333..682cea7a48 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 453b1951fc..de621617d2 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 ef2dceed89..0be8e10b07 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 ef2dceed89..0be8e10b07 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 035a5c0ada..e68f948cde 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 f2068f85f9..a5aeeb683c 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 15f73ee352..fb1d801da4 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 ef2dceed89..0be8e10b07 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 ef2dceed89..0be8e10b07 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 ef2dceed89..0be8e10b07 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 b19e5d76d6..30db431bcb 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 6c5dcf0be2..c6d62a87db 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 4c990578a4..7e5687a533 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 057fd09a97..94c2ace260 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 4c990578a4..7e5687a533 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 057fd09a97..94c2ace260 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 ef2dceed89..0be8e10b07 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 ef2dceed89..0be8e10b07 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 ef2dceed89..0be8e10b07 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 ef2dceed89..0be8e10b07 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 ef2dceed89..0be8e10b07 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 ef2dceed89..0be8e10b07 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 ef2dceed89..0be8e10b07 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 ef2dceed89..0be8e10b07 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 f2068f85f9..a5aeeb683c 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 ef2dceed89..0be8e10b07 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 ef2dceed89..0be8e10b07 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 ef2dceed89..0be8e10b07 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 ef2dceed89..0be8e10b07 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 1be4b92cf8..af1f2f5bef 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 ef2dceed89..0be8e10b07 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 e7fd49b40a..a6805922fe 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 d59b5261d4..f0e4d27549 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 858656e837..84791251b6 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 81b16255f7..8f2cf64c11 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 ea3993d10b..add8364625 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 f80cc2dca2..48427fa5c8 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 06b982917b..8bb0eec054 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 00e70444d0..7329c9cee5 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 ef2dceed89..0be8e10b07 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 f2068f85f9..a5aeeb683c 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 dae89b62b4..658cf12998 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 ef2dceed89..0be8e10b07 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 ef2dceed89..0be8e10b07 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 ef2dceed89..0be8e10b07 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 ef2dceed89..0be8e10b07 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) From 1a61345d380e0ef522d21af97f49409d030f912d Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Tue, 8 Apr 2014 18:39:40 -0400 Subject: [PATCH 2/5] added a space --- tests/test_basic/test_basic.py | 8 ++--- tests/test_cmfd_feed/test_cmfd_feed.py | 12 +++---- tests/test_cmfd_jfnk/test_cmfd_jfnk.py | 12 +++---- tests/test_cmfd_nofeed/test_cmfd_nofeed.py | 12 +++---- .../test_confidence_intervals.py | 12 +++---- .../test_density_atombcm.py | 8 ++--- .../test_density_atomcm3.py | 6 ++-- tests/test_density_kgm3/test_density_kgm3.py | 8 ++--- tests/test_density_sum/test_density_sum.py | 6 ++-- .../test_eigenvalue_genperbatch.py | 8 ++--- .../test_eigenvalue_no_inactive.py | 8 ++--- tests/test_energy_grid/test_energy_grid.py | 8 ++--- tests/test_entropy/test_entropy.py | 8 ++--- tests/test_filter_cell/test_filter_cell.py | 12 +++---- .../test_filter_cellborn.py | 12 +++---- .../test_filter_energy/test_filter_energy.py | 12 +++---- .../test_filter_energyout.py | 12 +++---- .../test_filter_group_transfer.py | 12 +++---- .../test_filter_material.py | 12 +++---- .../test_filter_mesh_2d.py | 12 +++---- .../test_filter_mesh_3d.py | 12 +++---- .../test_filter_universe.py | 12 +++---- tests/test_fixed_source/test_fixed_source.py | 12 +++---- tests/test_lattice/test_lattice.py | 8 ++--- .../test_lattice_multiple.py | 8 ++--- .../test_natural_element.py | 8 ++--- tests/test_output/test_output.py | 12 +++---- .../test_particle_restart.py | 2 +- tests/test_ptables_off/test_ptables_off.py | 8 ++--- .../test_reflective_cone.py | 8 ++--- .../test_reflective_cylinder.py | 8 ++--- .../test_reflective_plane.py | 8 ++--- .../test_reflective_sphere.py | 8 ++--- tests/test_rotation/test_rotation.py | 8 ++--- tests/test_salphabeta/test_salphabeta.py | 8 ++--- .../test_salphabeta_multiple.py | 8 ++--- tests/test_score_MT/test_score_MT.py | 12 +++---- .../test_score_absorption.py | 12 +++---- .../test_score_current/test_score_current.py | 12 +++---- tests/test_score_events/test_score_events.py | 12 +++---- .../test_score_fission/test_score_fission.py | 12 +++---- tests/test_score_flux/test_score_flux.py | 12 +++---- .../test_score_kappafission.py | 12 +++---- .../test_score_nufission.py | 12 +++---- .../test_score_nuscatter.py | 12 +++---- .../test_score_scatter/test_score_scatter.py | 12 +++---- .../test_score_scatter_n.py | 12 +++---- .../test_score_scatter_pn.py | 12 +++---- tests/test_score_total/test_score_total.py | 12 +++---- tests/test_seed/test_seed.py | 8 ++--- .../test_source_angle_mono.py | 8 ++--- .../test_source_energy_maxwell.py | 8 ++--- .../test_source_energy_mono.py | 8 ++--- tests/test_source_file/test_source_file.py | 14 ++++---- tests/test_source_point/test_source_point.py | 8 ++--- .../test_sourcepoint_batch.py | 2 +- .../test_sourcepoint_interval.py | 2 +- .../test_sourcepoint_latest.py | 12 +++---- .../test_sourcepoint_restart.py | 32 +++++++++---------- .../test_statepoint_batch.py | 2 +- .../test_statepoint_interval.py | 6 ++-- .../test_statepoint_restart.py | 26 +++++++-------- .../test_statepoint_sourcesep.py | 12 +++---- .../test_survival_biasing.py | 8 ++--- .../test_tally_assumesep.py | 12 +++---- tests/test_trace/test_trace.py | 8 ++--- tests/test_translation/test_translation.py | 8 ++--- tests/test_uniform_fs/test_uniform_fs.py | 8 ++--- tests/test_universe/test_universe.py | 8 ++--- tests/test_void/test_void.py | 8 ++--- 70 files changed, 351 insertions(+), 351 deletions(-) diff --git a/tests/test_basic/test_basic.py b/tests/test_basic/test_basic.py index 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 5610cfee4f..20ee11f4d2 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.20.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 ec984a74b3..f270c105a1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.20.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 ec984a74b3..f270c105a1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.20.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 bf28e47d1e..650d94cb97 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'results_test.dat')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 9d1a7e5671..db434dd378 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(os.path.join(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(os.path.join(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(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 682cea7a48..20e55c64c7 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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 de621617d2..59862c0281 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.7.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 e68f948cde..bdfb6269e2 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 fb1d801da4..cf1f0c2884 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(os.path.join(cwd,'statepoint.10.*')) + statepoint = glob.glob(os.path.join(cwd, 'statepoint.10.*')) def test_output_exists(): - assert os.path.exists(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 30db431bcb..cb960cfe64 100644 --- a/tests/test_output/test_output.py +++ b/tests/test_output/test_output.py @@ -24,7 +24,7 @@ def test_run(): assert returncode == 0, 'OpenMC did not exit successfully.' def test_summary_exists(): - summary = glob.glob(os.path.join(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.' @@ -34,13 +34,13 @@ def test_cross_sections_exists(): 'Cross section output file does not exist.' def test_statepoint_exists(): - statepoint = glob.glob(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) + glob.glob(os.path.join(cwd,'summary.*')) - output.append(os.path.join(cwd,'summary.out')) + 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')) + 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 c6d62a87db..e1dea5b054 100644 --- a/tests/test_particle_restart/test_particle_restart.py +++ b/tests/test_particle_restart/test_particle_restart.py @@ -46,7 +46,7 @@ def test_run_restart(): def teardown(): output = glob.glob(os.path.join(cwd, 'statepoint.*')) + \ glob.glob(os.path.join(cwd, 'particle_*')) + \ - [os.path.join(cwd,'results_test.dat')] + [os.path.join(cwd, 'results_test.dat')] 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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 af1f2f5bef..51801c4dd9 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(os.path.join(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(os.path.join(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 = os.path.join(cwd, '../../src/openmc') - source = glob.glob(os.path.join(cwd,'source.10.*')) + 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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output += glob.glob(os.path.join(cwd,'source.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 a6805922fe..28fd9badd2 100644 --- a/tests/test_sourcepoint_batch/test_sourcepoint_batch.py +++ b/tests/test_sourcepoint_batch/test_sourcepoint_batch.py @@ -39,7 +39,7 @@ def test_results(): def teardown(): output = glob.glob(os.path.join(cwd, 'statepoint.*')) - output.append(os.path.join(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_sourcepoint_interval/test_sourcepoint_interval.py b/tests/test_sourcepoint_interval/test_sourcepoint_interval.py index f0e4d27549..c667f8adba 100644 --- a/tests/test_sourcepoint_interval/test_sourcepoint_interval.py +++ b/tests/test_sourcepoint_interval/test_sourcepoint_interval.py @@ -39,7 +39,7 @@ def test_results(): def teardown(): output = glob.glob(os.path.join(cwd, 'statepoint.*')) - output.append(os.path.join(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_sourcepoint_latest/test_sourcepoint_latest.py b/tests/test_sourcepoint_latest/test_sourcepoint_latest.py index 84791251b6..198d7a346c 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output += glob.glob(os.path.join(cwd,'source.*')) - output.append(os.path.join(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 8f2cf64c11..56237c7f5c 100644 --- a/tests/test_sourcepoint_restart/test_sourcepoint_restart.py +++ b/tests/test_sourcepoint_restart/test_sourcepoint_restart.py @@ -28,13 +28,13 @@ def test_created_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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.7.*')) - sourcepoint = glob.glob(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.7.*')) - sourcepoint = glob.glob(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.7.*')) - sourcepoint = glob.glob(os.path.join(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(os.path.join(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(os.path.join(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: @@ -120,8 +120,8 @@ def test_results_serial(): def teardown(): 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')) + 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 add8364625..678369093e 100644 --- a/tests/test_statepoint_batch/test_statepoint_batch.py +++ b/tests/test_statepoint_batch/test_statepoint_batch.py @@ -47,7 +47,7 @@ def test_results(): def teardown(): output = glob.glob(os.path.join(cwd, 'statepoint*')) - output.append(os.path.join(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_statepoint_interval/test_statepoint_interval.py b/tests/test_statepoint_interval/test_statepoint_interval.py index 48427fa5c8..17a91fb3b0 100644 --- a/tests/test_statepoint_interval/test_statepoint_interval.py +++ b/tests/test_statepoint_interval/test_statepoint_interval.py @@ -41,13 +41,13 @@ def test_statepoints_exist(): 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(os.path.join(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(os.path.join(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: @@ -56,7 +56,7 @@ def test_results(): def teardown(): output = glob.glob(os.path.join(cwd, 'statepoint.*')) - output.append(os.path.join(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_statepoint_restart/test_statepoint_restart.py b/tests/test_statepoint_restart/test_statepoint_restart.py index 8bb0eec054..291fdef80d 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.7.*')) - output.append(os.path.join(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 7329c9cee5..79b4bc5240 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output += glob.glob(os.path.join(cwd,'source.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 a5aeeb683c..6e54389fc1 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(os.path.join(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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(cwd,'tallies.out')) - output.append(os.path.join(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 658cf12998..429939f894 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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 0be8e10b07..bcc3f8a819 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(os.path.join(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(os.path.join(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(os.path.join(cwd,'statepoint.10.*')) - output.append(os.path.join(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) From 11966227421b1815e4ad5c126c74dd5b4a25261c Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Thu, 10 Apr 2014 19:58:18 -0400 Subject: [PATCH 3/5] replaced has_key syntax --- tests/run_tests.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 74489feeb1..61c7702fb3 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -34,17 +34,17 @@ PHDF5_DIR='/opt/phdf5/1.8.12-gnu' PETSC_DIR='/opt/petsc/3.4.4-gnu' # Override default compiler paths if environmental vars are found -if os.environ.has_key('FC'): +if 'FC' in os.environ: FC = os.environ['FC'] if FC is not 'gfortran': print('NOTE: Test suite only verifed for gfortran compiler.') -if os.environ.has_key('MPI_DIR'): +if 'MPI_DIR' in os.environ: MPI_DIR = os.environ['MPI_DIR'] -if os.environ.has_key('HDF5_DIR'): +if 'HDF5_DIR' in os.environ: HDF5_DIR = os.environ['HDF5_DIR'] -if os.environ.has_key('PHDF5_DIR'): +if 'PHDF5_DIR' in os.environ: PHDF5_DIR = os.environ['PHDF5_DIR'] -if os.environ.has_key('PETSC_DIR'): +if 'PETSC_DIR' in os.environ: PETSC_DIR = os.environ['PETSC_DIR'] # Define test data structure From 995fa3f6023962894cdd50efb266585183129cb6 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 10 Apr 2014 20:08:21 -0400 Subject: [PATCH 4/5] Force flushing of print statements. --- tests/run_tests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/run_tests.py b/tests/run_tests.py index 61c7702fb3..43f6e1abfd 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -5,6 +5,7 @@ from __future__ import print_function import os import shutil import re +import sys from subprocess import call from collections import OrderedDict from optparse import OptionParser @@ -216,6 +217,7 @@ for test in tests: print('-'*(len(test) + 6)) print(test + ' tests') print('-'*(len(test) + 6)) + sys.stdout.flush() # Verify fortran compiler exists tests[test].check_compiler() From 04878cdb72715028fa125f81a77da8e827461ef1 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 10 Apr 2014 23:21:44 -0400 Subject: [PATCH 5/5] Don't use escape sequences if being redirected. --- tests/run_tests.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 43f6e1abfd..ce67f3ab7a 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -249,10 +249,16 @@ for test in tests: print('\n' + '='*54) print('Summary of Compilation Option Testing:\n') -OK = '\033[92m' -FAIL = '\033[91m' -ENDC = '\033[0m' -BOLD = '\033[1m' +if sys.stdout.isatty(): + OK = '\033[92m' + FAIL = '\033[91m' + ENDC = '\033[0m' + BOLD = '\033[1m' +else: + OK = '' + FAIL = '' + ENDC = '' + BOLD = '' for test in tests: print(test + '.'*(50 - len(test)), end='')