diff --git a/tests/resources/__init__.py b/tests/resources/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/bbox_constants.py b/tests/resources/bbox_constants.py similarity index 100% rename from tests/fixtures/bbox_constants.py rename to tests/resources/bbox_constants.py diff --git a/tests/test_write_layers_to_geotiff.py b/tests/resources/test_write_layers_to_geotiff.py similarity index 95% rename from tests/test_write_layers_to_geotiff.py rename to tests/resources/test_write_layers_to_geotiff.py index 5b3ddc2..e5a5431 100644 --- a/tests/test_write_layers_to_geotiff.py +++ b/tests/resources/test_write_layers_to_geotiff.py @@ -22,17 +22,17 @@ UrbanLandUse, WorldPop ) -from tests.fixtures.bbox_constants import * -from tools.general_tools import create_temp_folder, verify_file_is_populated +from tests.resources.bbox_constants import BBOX_BR_LAURO_DE_FREITAS_1 +from tools.general_tools import create_temp_folder -RUN_DUMPS = False +RUN_DUMPS = True BBOX = BBOX_BR_LAURO_DE_FREITAS_1 @pytest.mark.skipif(RUN_DUMPS == False, reason='Skipping since RUN_DUMPS set to False') -def test_prepare_target(): +def test_geotiff_writing(): qgis_project_file = 'layers_for_br_lauro_de_freitas.qgs' - source_folder = os.path.join(os.path.dirname(__file__), 'resources') + source_folder = os.path.dirname(__file__) output_temp_folder = create_temp_folder('test_result_tif_files') source_qgis_file = os.path.join(source_folder, qgis_project_file) target_qgis_file = os.path.join(output_temp_folder, qgis_project_file) @@ -163,3 +163,7 @@ def prep_output_path(output_temp_folder, file_name): if os.path.isfile(file_path): os.remove(file_path) return file_path + +def verify_file_is_populated(file_path): + is_populated = True if os.path.getsize(file_path) > 0 else False + return is_populated diff --git a/tests/test_layers.py b/tests/test_layers.py index 09e9369..7980aa1 100644 --- a/tests/test_layers.py +++ b/tests/test_layers.py @@ -24,7 +24,7 @@ WorldPop ) from city_metrix.layers.layer import get_image_collection -from tests.fixtures.bbox_constants import BBOX_BR_LAURO_DE_FREITAS_1 +from tests.resources.bbox_constants import BBOX_BR_LAURO_DE_FREITAS_1 EE_IMAGE_DIMENSION_TOLERANCE = 1 # Tolerance compensates for variable results from GEE service diff --git a/tools/general_tools.py b/tools/general_tools.py index aa082a1..fb1f437 100644 --- a/tools/general_tools.py +++ b/tools/general_tools.py @@ -15,6 +15,3 @@ def create_temp_folder(sub_directory): return path -def verify_file_is_populated(file_path): - is_populated = True if os.path.getsize(file_path) > 0 else False - return is_populated