Skip to content

Commit

Permalink
linter fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HansVRP committed Aug 14, 2024
1 parent 5aa5bb2 commit 849bc55
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 4 additions & 4 deletions tests/test_openeo_gfmap/test_commons.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_resample_reproject_valid_epsg():
mock_datacube.resample_spatial.return_value = mock_resampled_datacube

# Call the resample_reproject function
result = resample_reproject(
resample_reproject(
mock_datacube, resolution=10.0, epsg_code="4326", method="bilinear"
)

Expand Down Expand Up @@ -108,7 +108,7 @@ def test_resample_reproject_only_resolution():
mock_datacube.resample_spatial.return_value = mock_resampled_datacube

# Call the resample_reproject function with only resolution provided
result = resample_reproject(mock_datacube, resolution=20.0)
resample_reproject(mock_datacube, resolution=20.0)

# Ensure resample_spatial was called correctly with the resolution and default method
mock_datacube.resample_spatial.assert_called_once_with(
Expand All @@ -127,7 +127,7 @@ def test_resample_reproject_no_epsg():
mock_datacube.resample_spatial.return_value = mock_resampled_datacube

# Call the resample_reproject function without specifying an EPSG code
result = resample_reproject(
resample_reproject(
mock_datacube, resolution=10.0, epsg_code=None, method="bilinear"
)

Expand All @@ -148,7 +148,7 @@ def test_resample_reproject_default_method():
mock_datacube.resample_spatial.return_value = mock_resampled_datacube

# Call the resample_reproject function with default method ("near")
result = resample_reproject(mock_datacube, resolution=10.0, epsg_code="4326")
resample_reproject(mock_datacube, resolution=10.0, epsg_code="4326")

# Ensure resample_spatial was called correctly with the default method
mock_datacube.resample_spatial.assert_called_once_with(
Expand Down
8 changes: 3 additions & 5 deletions tests/test_openeo_gfmap/test_unit_s2_extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def test_fetch_function_calls_convert_and_load(
mock_convert_band_names.return_value = BANDS

# Call the fetch function
result = fetcher(mock_connection, mock_spatial_extent, mock_temporal_extent, BANDS)
fetcher(mock_connection, mock_spatial_extent, mock_temporal_extent, BANDS)

# Assert that convert_band_names was called with correct bands
mock_convert_band_names.assert_called_once_with(BANDS, BASE_SENTINEL2_L2A_MAPPING)
Expand Down Expand Up @@ -156,10 +156,7 @@ def test_processor_calls_resample_reproject_and_rename_bands(


# test error in case only target crs is given and not target resolution
@patch("openeo_gfmap.fetching.s2.resample_reproject")
def test_processor_raises_valueerror_for_missing_resolution(
mock_resample_reproject, mock_datacube
):
def test_processor_raises_valueerror_for_missing_resolution(mock_datacube):
"""Test that the processor raises a ValueError if target_crs is specified without target_resolution."""
processor = _get_s2_l2a_default_processor(COLLECTION_NAME, FETCH_TYPE)

Expand Down Expand Up @@ -210,6 +207,7 @@ def test_processor_changes_datatype_to_uint16(mock_rename_bands, mock_datacube):

# Check that linear_scale_range was called with the correct parameters
mock_datacube.linear_scale_range.assert_called_once_with(0, 65534, 0, 65534)
assert isinstance(result_cube, openeo.DataCube)


# test the extractor
Expand Down

0 comments on commit 849bc55

Please sign in to comment.