From 0c68aef469aa7d624523c60c840a783264756dbf Mon Sep 17 00:00:00 2001 From: Andreas Hoenselaar Date: Wed, 9 Jun 2021 09:27:05 -0700 Subject: [PATCH] Rename Python test files to be pytest compatible (#1599) --- python/Makefile.am | 102 +++++++++--------- .../{3rd_harm_1d.py => test_3rd_harm_1d.py} | 0 .../{absorber_1d.py => test_absorber_1d.py} | 0 .../{adjoint_jax.py => test_adjoint_jax.py} | 0 ...joint_solver.py => test_adjoint_solver.py} | 0 ...radiation.py => test_antenna_radiation.py} | 0 ...ray_metadata.py => test_array_metadata.py} | 0 .../tests/{bend_flux.py => test_bend_flux.py} | 0 ...nary_grating.py => test_binary_grating.py} | 0 ...rrayslice.py => test_cavity_arrayslice.py} | 0 ...ty_farfield.py => test_cavity_farfield.py} | 0 .../{chunk_layout.py => test_chunk_layout.py} | 0 python/tests/{chunks.py => test_chunks.py} | 0 ...cyl_ellipsoid.py => test_cyl_ellipsoid.py} | 0 .../{dft_energy.py => test_dft_energy.py} | 0 .../{dft_fields.py => test_dft_fields.py} | 0 ...newave.py => test_diffracted_planewave.py} | 0 ...enmode.py => test_dispersive_eigenmode.py} | 3 +- ...cesses.py => test_divide_mpi_processes.py} | 0 python/tests/{eigfreq.py => test_eigfreq.py} | 0 ...y_rotation.py => test_faraday_rotation.py} | 0 ...d_functions.py => test_field_functions.py} | 0 python/tests/{force.py => test_force.py} | 0 ...agment_stats.py => test_fragment_stats.py} | 0 .../{gaussianbeam.py => test_gaussianbeam.py} | 0 python/tests/{geom.py => test_geom.py} | 0 .../tests/{get_point.py => test_get_point.py} | 0 ...y_wvg_bands.py => test_holey_wvg_bands.py} | 0 ...wvg_cavity.py => test_holey_wvg_cavity.py} | 0 python/tests/{kdom.py => test_kdom.py} | 0 python/tests/{ldos.py => test_ldos.py} | 0 ...persion.py => test_material_dispersion.py} | 0 ...material_grid.py => test_material_grid.py} | 0 ...luations.py => test_medium_evaluations.py} | 0 .../{mode_coeffs.py => test_mode_coeffs.py} | 0 ...position.py => test_mode_decomposition.py} | 0 python/tests/{mpb.py => test_mpb.py} | 0 ...ilevel_atom.py => test_multilevel_atom.py} | 0 .../{n2f_periodic.py => test_n2f_periodic.py} | 0 ...lique_source.py => test_oblique_source.py} | 0 .../tests/{physical.py => test_physical.py} | 0 python/tests/{prism.py => test_prism.py} | 0 .../tests/{pw_source.py => test_pw_source.py} | 0 .../{refl_angular.py => test_refl_angular.py} | 0 python/tests/{ring.py => test_ring.py} | 0 .../tests/{ring_cyl.py => test_ring_cyl.py} | 0 .../{simulation.py => test_simulation.py} | 12 ++- python/tests/{source.py => test_source.py} | 0 .../{special_kz.py => test_special_kz.py} | 0 ...erial.py => test_user_defined_material.py} | 0 ...visualization.py => test_visualization.py} | 0 python/tests/{wvg_src.py => test_wvg_src.py} | 0 52 files changed, 61 insertions(+), 56 deletions(-) rename python/tests/{3rd_harm_1d.py => test_3rd_harm_1d.py} (100%) rename python/tests/{absorber_1d.py => test_absorber_1d.py} (100%) rename python/tests/{adjoint_jax.py => test_adjoint_jax.py} (100%) rename python/tests/{adjoint_solver.py => test_adjoint_solver.py} (100%) rename python/tests/{antenna_radiation.py => test_antenna_radiation.py} (100%) rename python/tests/{array_metadata.py => test_array_metadata.py} (100%) rename python/tests/{bend_flux.py => test_bend_flux.py} (100%) rename python/tests/{binary_grating.py => test_binary_grating.py} (100%) rename python/tests/{cavity_arrayslice.py => test_cavity_arrayslice.py} (100%) rename python/tests/{cavity_farfield.py => test_cavity_farfield.py} (100%) rename python/tests/{chunk_layout.py => test_chunk_layout.py} (100%) rename python/tests/{chunks.py => test_chunks.py} (100%) rename python/tests/{cyl_ellipsoid.py => test_cyl_ellipsoid.py} (100%) rename python/tests/{dft_energy.py => test_dft_energy.py} (100%) rename python/tests/{dft_fields.py => test_dft_fields.py} (100%) rename python/tests/{diffracted_planewave.py => test_diffracted_planewave.py} (100%) rename python/tests/{dispersive_eigenmode.py => test_dispersive_eigenmode.py} (97%) rename python/tests/{divide_mpi_processes.py => test_divide_mpi_processes.py} (100%) rename python/tests/{eigfreq.py => test_eigfreq.py} (100%) rename python/tests/{faraday_rotation.py => test_faraday_rotation.py} (100%) rename python/tests/{field_functions.py => test_field_functions.py} (100%) rename python/tests/{force.py => test_force.py} (100%) rename python/tests/{fragment_stats.py => test_fragment_stats.py} (100%) rename python/tests/{gaussianbeam.py => test_gaussianbeam.py} (100%) rename python/tests/{geom.py => test_geom.py} (100%) rename python/tests/{get_point.py => test_get_point.py} (100%) rename python/tests/{holey_wvg_bands.py => test_holey_wvg_bands.py} (100%) rename python/tests/{holey_wvg_cavity.py => test_holey_wvg_cavity.py} (100%) rename python/tests/{kdom.py => test_kdom.py} (100%) rename python/tests/{ldos.py => test_ldos.py} (100%) rename python/tests/{material_dispersion.py => test_material_dispersion.py} (100%) rename python/tests/{material_grid.py => test_material_grid.py} (100%) rename python/tests/{medium_evaluations.py => test_medium_evaluations.py} (100%) rename python/tests/{mode_coeffs.py => test_mode_coeffs.py} (100%) rename python/tests/{mode_decomposition.py => test_mode_decomposition.py} (100%) rename python/tests/{mpb.py => test_mpb.py} (100%) rename python/tests/{multilevel_atom.py => test_multilevel_atom.py} (100%) rename python/tests/{n2f_periodic.py => test_n2f_periodic.py} (100%) rename python/tests/{oblique_source.py => test_oblique_source.py} (100%) rename python/tests/{physical.py => test_physical.py} (100%) rename python/tests/{prism.py => test_prism.py} (100%) rename python/tests/{pw_source.py => test_pw_source.py} (100%) rename python/tests/{refl_angular.py => test_refl_angular.py} (100%) rename python/tests/{ring.py => test_ring.py} (100%) rename python/tests/{ring_cyl.py => test_ring_cyl.py} (100%) rename python/tests/{simulation.py => test_simulation.py} (98%) rename python/tests/{source.py => test_source.py} (100%) rename python/tests/{special_kz.py => test_special_kz.py} (100%) rename python/tests/{user_defined_material.py => test_user_defined_material.py} (100%) rename python/tests/{visualization.py => test_visualization.py} (100%) rename python/tests/{wvg_src.py => test_wvg_src.py} (100%) diff --git a/python/Makefile.am b/python/Makefile.am index 58b125832..5f126845c 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -8,22 +8,22 @@ if WITH_MPI MDPYTEST= MPBPYTEST= else - MDPYTEST=$(TEST_DIR)/material_dispersion.py + MDPYTEST=$(TEST_DIR)/test_material_dispersion.py if WITH_MPB - MPBPYTEST=$(TEST_DIR)/mpb.py + MPBPYTEST=$(TEST_DIR)/test_mpb.py else MPBPYTEST= endif # WITH_MPB endif # WITH_MPI if WITH_MPB - BINARY_GRATING_TEST = $(TEST_DIR)/binary_grating.py - DIFFRACTED_PLANEWAVE_TEST = $(TEST_DIR)/diffracted_planewave.py - DISPERSIVE_EIGENMODE_TEST = $(TEST_DIR)/dispersive_eigenmode.py - KDOM_TEST = $(TEST_DIR)/kdom.py - MODE_COEFFS_TEST = $(TEST_DIR)/mode_coeffs.py - MODE_DECOMPOSITION_TEST = $(TEST_DIR)/mode_decomposition.py - WVG_SRC_TEST = $(TEST_DIR)/wvg_src.py + BINARY_GRATING_TEST = $(TEST_DIR)/test_binary_grating.py + DIFFRACTED_PLANEWAVE_TEST = $(TEST_DIR)/test_diffracted_planewave.py + DISPERSIVE_EIGENMODE_TEST = $(TEST_DIR)/test_dispersive_eigenmode.py + KDOM_TEST = $(TEST_DIR)/test_kdom.py + MODE_COEFFS_TEST = $(TEST_DIR)/test_mode_coeffs.py + MODE_DECOMPOSITION_TEST = $(TEST_DIR)/test_mode_decomposition.py + WVG_SRC_TEST = $(TEST_DIR)/test_wvg_src.py else BINARY_GRATING_TEST = DIFFRACTED_PLANEWAVE_TEST = @@ -35,56 +35,56 @@ else endif TESTS = \ - $(TEST_DIR)/3rd_harm_1d.py \ - $(TEST_DIR)/absorber_1d.py \ - $(TEST_DIR)/adjoint_solver.py \ - $(TEST_DIR)/adjoint_jax.py \ - $(TEST_DIR)/antenna_radiation.py \ - $(TEST_DIR)/array_metadata.py \ - $(TEST_DIR)/bend_flux.py \ + $(TEST_DIR)/test_3rd_harm_1d.py \ + $(TEST_DIR)/test_absorber_1d.py \ + $(TEST_DIR)/test_adjoint_solver.py \ + $(TEST_DIR)/test_adjoint_jax.py \ + $(TEST_DIR)/test_antenna_radiation.py \ + $(TEST_DIR)/test_array_metadata.py \ + $(TEST_DIR)/test_bend_flux.py \ $(BINARY_GRATING_TEST) \ - $(TEST_DIR)/cavity_arrayslice.py \ - $(TEST_DIR)/cavity_farfield.py \ - $(TEST_DIR)/chunk_layout.py \ - $(TEST_DIR)/chunks.py \ - $(TEST_DIR)/cyl_ellipsoid.py \ - $(TEST_DIR)/dft_energy.py \ - $(TEST_DIR)/dft_fields.py \ + $(TEST_DIR)/test_cavity_arrayslice.py \ + $(TEST_DIR)/test_cavity_farfield.py \ + $(TEST_DIR)/test_chunk_layout.py \ + $(TEST_DIR)/test_chunks.py \ + $(TEST_DIR)/test_cyl_ellipsoid.py \ + $(TEST_DIR)/test_dft_energy.py \ + $(TEST_DIR)/test_dft_fields.py \ ${DIFFRACTED_PLANEWAVE_TEST} \ ${DISPERSIVE_EIGENMODE_TEST} \ - $(TEST_DIR)/divide_mpi_processes.py \ - $(TEST_DIR)/eigfreq.py \ - $(TEST_DIR)/faraday_rotation.py \ - $(TEST_DIR)/field_functions.py \ - $(TEST_DIR)/force.py \ - $(TEST_DIR)/fragment_stats.py \ - $(TEST_DIR)/gaussianbeam.py \ - $(TEST_DIR)/geom.py \ - $(TEST_DIR)/get_point.py \ - $(TEST_DIR)/holey_wvg_bands.py \ - $(TEST_DIR)/holey_wvg_cavity.py \ + $(TEST_DIR)/test_divide_mpi_processes.py \ + $(TEST_DIR)/test_eigfreq.py \ + $(TEST_DIR)/test_faraday_rotation.py \ + $(TEST_DIR)/test_field_functions.py \ + $(TEST_DIR)/test_force.py \ + $(TEST_DIR)/test_fragment_stats.py \ + $(TEST_DIR)/test_gaussianbeam.py \ + $(TEST_DIR)/test_geom.py \ + $(TEST_DIR)/test_get_point.py \ + $(TEST_DIR)/test_holey_wvg_bands.py \ + $(TEST_DIR)/test_holey_wvg_cavity.py \ $(KDOM_TEST) \ - $(TEST_DIR)/ldos.py \ + $(TEST_DIR)/test_ldos.py \ $(MDPYTEST) \ - $(TEST_DIR)/material_grid.py \ - $(TEST_DIR)/medium_evaluations.py \ + $(TEST_DIR)/test_material_grid.py \ + $(TEST_DIR)/test_medium_evaluations.py \ $(MPBPYTEST) \ $(MODE_COEFFS_TEST) \ $(MODE_DECOMPOSITION_TEST) \ - $(TEST_DIR)/multilevel_atom.py \ - $(TEST_DIR)/n2f_periodic.py \ - $(TEST_DIR)/oblique_source.py \ - $(TEST_DIR)/physical.py \ - $(TEST_DIR)/prism.py \ - $(TEST_DIR)/pw_source.py \ - $(TEST_DIR)/refl_angular.py \ - $(TEST_DIR)/ring.py \ - $(TEST_DIR)/ring_cyl.py \ - $(TEST_DIR)/simulation.py \ - $(TEST_DIR)/special_kz.py \ - $(TEST_DIR)/source.py \ - $(TEST_DIR)/user_defined_material.py \ - $(TEST_DIR)/visualization.py \ + $(TEST_DIR)/test_multilevel_atom.py \ + $(TEST_DIR)/test_n2f_periodic.py \ + $(TEST_DIR)/test_oblique_source.py \ + $(TEST_DIR)/test_physical.py \ + $(TEST_DIR)/test_prism.py \ + $(TEST_DIR)/test_pw_source.py \ + $(TEST_DIR)/test_refl_angular.py \ + $(TEST_DIR)/test_ring.py \ + $(TEST_DIR)/test_ring_cyl.py \ + $(TEST_DIR)/test_simulation.py \ + $(TEST_DIR)/test_special_kz.py \ + $(TEST_DIR)/test_source.py \ + $(TEST_DIR)/test_user_defined_material.py \ + $(TEST_DIR)/test_visualization.py \ $(WVG_SRC_TEST) if WITH_COVERAGE diff --git a/python/tests/3rd_harm_1d.py b/python/tests/test_3rd_harm_1d.py similarity index 100% rename from python/tests/3rd_harm_1d.py rename to python/tests/test_3rd_harm_1d.py diff --git a/python/tests/absorber_1d.py b/python/tests/test_absorber_1d.py similarity index 100% rename from python/tests/absorber_1d.py rename to python/tests/test_absorber_1d.py diff --git a/python/tests/adjoint_jax.py b/python/tests/test_adjoint_jax.py similarity index 100% rename from python/tests/adjoint_jax.py rename to python/tests/test_adjoint_jax.py diff --git a/python/tests/adjoint_solver.py b/python/tests/test_adjoint_solver.py similarity index 100% rename from python/tests/adjoint_solver.py rename to python/tests/test_adjoint_solver.py diff --git a/python/tests/antenna_radiation.py b/python/tests/test_antenna_radiation.py similarity index 100% rename from python/tests/antenna_radiation.py rename to python/tests/test_antenna_radiation.py diff --git a/python/tests/array_metadata.py b/python/tests/test_array_metadata.py similarity index 100% rename from python/tests/array_metadata.py rename to python/tests/test_array_metadata.py diff --git a/python/tests/bend_flux.py b/python/tests/test_bend_flux.py similarity index 100% rename from python/tests/bend_flux.py rename to python/tests/test_bend_flux.py diff --git a/python/tests/binary_grating.py b/python/tests/test_binary_grating.py similarity index 100% rename from python/tests/binary_grating.py rename to python/tests/test_binary_grating.py diff --git a/python/tests/cavity_arrayslice.py b/python/tests/test_cavity_arrayslice.py similarity index 100% rename from python/tests/cavity_arrayslice.py rename to python/tests/test_cavity_arrayslice.py diff --git a/python/tests/cavity_farfield.py b/python/tests/test_cavity_farfield.py similarity index 100% rename from python/tests/cavity_farfield.py rename to python/tests/test_cavity_farfield.py diff --git a/python/tests/chunk_layout.py b/python/tests/test_chunk_layout.py similarity index 100% rename from python/tests/chunk_layout.py rename to python/tests/test_chunk_layout.py diff --git a/python/tests/chunks.py b/python/tests/test_chunks.py similarity index 100% rename from python/tests/chunks.py rename to python/tests/test_chunks.py diff --git a/python/tests/cyl_ellipsoid.py b/python/tests/test_cyl_ellipsoid.py similarity index 100% rename from python/tests/cyl_ellipsoid.py rename to python/tests/test_cyl_ellipsoid.py diff --git a/python/tests/dft_energy.py b/python/tests/test_dft_energy.py similarity index 100% rename from python/tests/dft_energy.py rename to python/tests/test_dft_energy.py diff --git a/python/tests/dft_fields.py b/python/tests/test_dft_fields.py similarity index 100% rename from python/tests/dft_fields.py rename to python/tests/test_dft_fields.py diff --git a/python/tests/diffracted_planewave.py b/python/tests/test_diffracted_planewave.py similarity index 100% rename from python/tests/diffracted_planewave.py rename to python/tests/test_diffracted_planewave.py diff --git a/python/tests/dispersive_eigenmode.py b/python/tests/test_dispersive_eigenmode.py similarity index 97% rename from python/tests/dispersive_eigenmode.py rename to python/tests/test_dispersive_eigenmode.py index afe20b3f6..e12f318c7 100644 --- a/python/tests/dispersive_eigenmode.py +++ b/python/tests/test_dispersive_eigenmode.py @@ -67,7 +67,8 @@ def verify_output_and_slice(self,material,frequency): self.assertAlmostEqual(n,n_slice, places=4) # Check to make sure h5 output is working with frequency - filename = os.path.join(self.temp_dir, 'dispersive_eigenmode-eps-000000.00.h5') + filename = os.path.join(self.temp_dir, + sim.get_filename_prefix() + '-eps-000000.00.h5') mp.output_epsilon(sim,frequency=frequency) n_h5 = 0 mp.all_wait() diff --git a/python/tests/divide_mpi_processes.py b/python/tests/test_divide_mpi_processes.py similarity index 100% rename from python/tests/divide_mpi_processes.py rename to python/tests/test_divide_mpi_processes.py diff --git a/python/tests/eigfreq.py b/python/tests/test_eigfreq.py similarity index 100% rename from python/tests/eigfreq.py rename to python/tests/test_eigfreq.py diff --git a/python/tests/faraday_rotation.py b/python/tests/test_faraday_rotation.py similarity index 100% rename from python/tests/faraday_rotation.py rename to python/tests/test_faraday_rotation.py diff --git a/python/tests/field_functions.py b/python/tests/test_field_functions.py similarity index 100% rename from python/tests/field_functions.py rename to python/tests/test_field_functions.py diff --git a/python/tests/force.py b/python/tests/test_force.py similarity index 100% rename from python/tests/force.py rename to python/tests/test_force.py diff --git a/python/tests/fragment_stats.py b/python/tests/test_fragment_stats.py similarity index 100% rename from python/tests/fragment_stats.py rename to python/tests/test_fragment_stats.py diff --git a/python/tests/gaussianbeam.py b/python/tests/test_gaussianbeam.py similarity index 100% rename from python/tests/gaussianbeam.py rename to python/tests/test_gaussianbeam.py diff --git a/python/tests/geom.py b/python/tests/test_geom.py similarity index 100% rename from python/tests/geom.py rename to python/tests/test_geom.py diff --git a/python/tests/get_point.py b/python/tests/test_get_point.py similarity index 100% rename from python/tests/get_point.py rename to python/tests/test_get_point.py diff --git a/python/tests/holey_wvg_bands.py b/python/tests/test_holey_wvg_bands.py similarity index 100% rename from python/tests/holey_wvg_bands.py rename to python/tests/test_holey_wvg_bands.py diff --git a/python/tests/holey_wvg_cavity.py b/python/tests/test_holey_wvg_cavity.py similarity index 100% rename from python/tests/holey_wvg_cavity.py rename to python/tests/test_holey_wvg_cavity.py diff --git a/python/tests/kdom.py b/python/tests/test_kdom.py similarity index 100% rename from python/tests/kdom.py rename to python/tests/test_kdom.py diff --git a/python/tests/ldos.py b/python/tests/test_ldos.py similarity index 100% rename from python/tests/ldos.py rename to python/tests/test_ldos.py diff --git a/python/tests/material_dispersion.py b/python/tests/test_material_dispersion.py similarity index 100% rename from python/tests/material_dispersion.py rename to python/tests/test_material_dispersion.py diff --git a/python/tests/material_grid.py b/python/tests/test_material_grid.py similarity index 100% rename from python/tests/material_grid.py rename to python/tests/test_material_grid.py diff --git a/python/tests/medium_evaluations.py b/python/tests/test_medium_evaluations.py similarity index 100% rename from python/tests/medium_evaluations.py rename to python/tests/test_medium_evaluations.py diff --git a/python/tests/mode_coeffs.py b/python/tests/test_mode_coeffs.py similarity index 100% rename from python/tests/mode_coeffs.py rename to python/tests/test_mode_coeffs.py diff --git a/python/tests/mode_decomposition.py b/python/tests/test_mode_decomposition.py similarity index 100% rename from python/tests/mode_decomposition.py rename to python/tests/test_mode_decomposition.py diff --git a/python/tests/mpb.py b/python/tests/test_mpb.py similarity index 100% rename from python/tests/mpb.py rename to python/tests/test_mpb.py diff --git a/python/tests/multilevel_atom.py b/python/tests/test_multilevel_atom.py similarity index 100% rename from python/tests/multilevel_atom.py rename to python/tests/test_multilevel_atom.py diff --git a/python/tests/n2f_periodic.py b/python/tests/test_n2f_periodic.py similarity index 100% rename from python/tests/n2f_periodic.py rename to python/tests/test_n2f_periodic.py diff --git a/python/tests/oblique_source.py b/python/tests/test_oblique_source.py similarity index 100% rename from python/tests/oblique_source.py rename to python/tests/test_oblique_source.py diff --git a/python/tests/physical.py b/python/tests/test_physical.py similarity index 100% rename from python/tests/physical.py rename to python/tests/test_physical.py diff --git a/python/tests/prism.py b/python/tests/test_prism.py similarity index 100% rename from python/tests/prism.py rename to python/tests/test_prism.py diff --git a/python/tests/pw_source.py b/python/tests/test_pw_source.py similarity index 100% rename from python/tests/pw_source.py rename to python/tests/test_pw_source.py diff --git a/python/tests/refl_angular.py b/python/tests/test_refl_angular.py similarity index 100% rename from python/tests/refl_angular.py rename to python/tests/test_refl_angular.py diff --git a/python/tests/ring.py b/python/tests/test_ring.py similarity index 100% rename from python/tests/ring.py rename to python/tests/test_ring.py diff --git a/python/tests/ring_cyl.py b/python/tests/test_ring_cyl.py similarity index 100% rename from python/tests/ring_cyl.py rename to python/tests/test_ring_cyl.py diff --git a/python/tests/simulation.py b/python/tests/test_simulation.py similarity index 98% rename from python/tests/simulation.py rename to python/tests/test_simulation.py index b897f955b..5cf5e5201 100644 --- a/python/tests/simulation.py +++ b/python/tests/test_simulation.py @@ -1,4 +1,5 @@ import os +import re import sys import unittest import warnings @@ -14,7 +15,8 @@ class TestSimulation(unittest.TestCase): - fname = 'simulation-ez-000200.00.h5' + fname_base = re.sub(r'\.py$', '', os.path.split(sys.argv[0])[1]) + fname = fname_base + '-ez-000200.00.h5' def setUp(self): print("Running {}".format(self._testMethodName)) @@ -138,7 +140,8 @@ def test_at_time(self): sim.use_output_directory(self.temp_dir) sim.run(mp.at_time(100, mp.output_efield_z), until=200) - fname = os.path.join(self.temp_dir, 'simulation-ez-000100.00.h5') + fname = os.path.join(self.temp_dir, + sim.get_filename_prefix() + '-ez-000100.00.h5') self.assertTrue(os.path.exists(fname)) def test_after_sources_and_time(self): @@ -158,7 +161,8 @@ def test_with_prefix(self): sim.use_output_directory(self.temp_dir) sim.run(mp.with_prefix('test_prefix-', mp.at_end(mp.output_efield_z)), until=200) - fname = os.path.join(self.temp_dir, 'test_prefix-simulation-ez-000200.00.h5') + fname = os.path.join(self.temp_dir, 'test_prefix-' + sim.get_filename_prefix() + + '-ez-000200.00.h5') self.assertTrue(os.path.exists(fname)) def test_extra_materials(self): @@ -529,7 +533,7 @@ def test_epsilon_warning(self): def test_get_filename_prefix(self): sim = self.init_simple_simulation() - self.assertEqual(sim.get_filename_prefix(), "simulation") + self.assertEqual(sim.get_filename_prefix(), self.fname_base) sim.filename_prefix = '' self.assertEqual(sim.get_filename_prefix(), "") sim.filename_prefix = False diff --git a/python/tests/source.py b/python/tests/test_source.py similarity index 100% rename from python/tests/source.py rename to python/tests/test_source.py diff --git a/python/tests/special_kz.py b/python/tests/test_special_kz.py similarity index 100% rename from python/tests/special_kz.py rename to python/tests/test_special_kz.py diff --git a/python/tests/user_defined_material.py b/python/tests/test_user_defined_material.py similarity index 100% rename from python/tests/user_defined_material.py rename to python/tests/test_user_defined_material.py diff --git a/python/tests/visualization.py b/python/tests/test_visualization.py similarity index 100% rename from python/tests/visualization.py rename to python/tests/test_visualization.py diff --git a/python/tests/wvg_src.py b/python/tests/test_wvg_src.py similarity index 100% rename from python/tests/wvg_src.py rename to python/tests/test_wvg_src.py