Skip to content

Commit

Permalink
added couple of unit tests to is_index_subset function to test empty …
Browse files Browse the repository at this point in the history
…lists
  • Loading branch information
sudha-murthy committed Aug 20, 2024
1 parent 2428ed6 commit 424bda3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
## v1.0.5
### 2024-08-19

This version of HOSS updates the 'is_index_subset' method to check for empty list (in case of dimensions subset)
as well as None (for the spatial, bbox and temporal subsets. This prevents prefetch from being called for
variable subsetting which was occuring for SMAP L3/L4 collections.
This version of HOSS updates the 'is_index_subset' method to check for empty list (in case of dimensions subset)
as well as None (for the spatial, bbox and temporal subsets. This prevents prefetch from being called for
variable subsetting which was occuring for SMAP L3/L4 collections.

## v1.0.4
### 2024-04-05
Expand Down
32 changes: 32 additions & 0 deletions tests/unit/test_dimension_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,38 @@ def test_is_index_subset(self):
)
)

with self.subTest('No index Subset'):
self.assertFalse(
is_index_subset(
Message(
{
'subset': {
'bbox': None,
'shape_file': None,
'dimensions': [],
},
'temporal': None,
}
)
)
)

with self.subTest('Dimensions Subset is not empty'):
self.assertTrue(
is_index_subset(
Message(
{
'subset': {
'bbox': None,
'shape_file': None,
'dimensions': dimensions,
},
'temporal': None,
}
)
)
)

with self.subTest('Not an index range subset'):
self.assertFalse(is_index_subset(Message({})))

Expand Down

0 comments on commit 424bda3

Please sign in to comment.