Skip to content

Commit

Permalink
ignore_keys test
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyCMWF committed Jun 21, 2024
1 parent 4da53e1 commit 8d4f14e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_30_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ def test_build_dataset_components_time_dims() -> None:
assert dims == {"number": 28, "indexing_time": 2, "step": 20, "latitude": 6, "longitude": 11}


def test_build_dataset_components_ignore_keys() -> None:
stream = messages.FileStream(TEST_DATA_UKMO, "warn")
index = dataset.open_fileindex(stream, messages.DEFAULT_INDEXPATH, dataset.INDEX_KEYS)
assert "subCentre" in index.index_keys
index = dataset.open_fileindex(stream, messages.DEFAULT_INDEXPATH, index_keys, ignore_keys=["subCentre"])
assert "subCentre" not in index.index_keys

def test_Dataset() -> None:
res = dataset.open_file(TEST_DATA)
assert "Conventions" in res.attributes
Expand Down

0 comments on commit 8d4f14e

Please sign in to comment.