diff --git a/tests/datasets/test_eurocrops.py b/tests/datasets/test_eurocrops.py index 3b2d4fc63f7..63896e23090 100644 --- a/tests/datasets/test_eurocrops.py +++ b/tests/datasets/test_eurocrops.py @@ -82,6 +82,11 @@ def test_invalid_query(self, dataset: EuroCrops) -> None: ): dataset[query] + def test_get_label_with_none_hcat_code(self, dataset: EuroCrops) -> None: + mock_feature = {'properties': {dataset.label_name: None}} + label = dataset.get_label(mock_feature) + assert label == 0, "Expected label to be 0 when 'EC_hcat_c' is None." + def test_integrity_error(self, dataset: EuroCrops) -> None: dataset.zenodo_files = (('AA.zip', 'invalid'),) assert not dataset._check_integrity()