Skip to content

Commit

Permalink
unit test for the win
Browse files Browse the repository at this point in the history
  • Loading branch information
burakekim committed Jan 3, 2025
1 parent 1b18387 commit 3590666
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/datasets/test_eurocrops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 3590666

Please sign in to comment.