Skip to content

Commit

Permalink
Add test querying for a wavelength on no-wavelength DataIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Dec 17, 2024
1 parent ed2867a commit d223f10
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions satpy/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,19 @@ def test_inequality_diff_required_keys(self):
"""Check (in)equality."""
assert DataQuery(wavelength=10) != DataID(self.default_id_keys_config, name="VIS006")

def test_id_filtering_no_id_wavelength(self):
"""Test that a DataID with no wavelength doesn't match a query for a wavelength."""
did_keys = {
"name": {"required": True},
"level": {},
"modifiers": {"default": [], "type": ModifierTuple}
}
did1 = DataID(did_keys, name="test1")
did2 = DataID(did_keys, name="test2")
dq = DataQuery(wavelength=1.8, modifiers=())
matched_ids = dq.filter_dataids([did1, did2])
assert len(matched_ids) == 0

def test_sort_dataids(self):
"""Check dataid sorting."""
dq = DataQuery(name="cheese_shops", wavelength=2, modifiers="*")
Expand Down

0 comments on commit d223f10

Please sign in to comment.