From b5b4229990a48d4443c6a6f38e5859679513c251 Mon Sep 17 00:00:00 2001 From: mbsantiago Date: Mon, 23 Jun 2025 19:08:55 +0100 Subject: [PATCH] Fix testing issues --- tests/test_postprocessing/test_decoding.py | 7 ++++--- tests/test_targets/test_terms.py | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/test_postprocessing/test_decoding.py b/tests/test_postprocessing/test_decoding.py index 151146a..9d06919 100644 --- a/tests/test_postprocessing/test_decoding.py +++ b/tests/test_postprocessing/test_decoding.py @@ -1,5 +1,5 @@ from pathlib import Path -from typing import List, Tuple +from typing import List, Optional, Tuple import numpy as np import pytest @@ -25,6 +25,7 @@ def dummy_geometry_builder(): def _builder( position: Tuple[float, float], dimensions: xr.DataArray, + class_name: Optional[str] = None, ) -> data.BoundingBox: time, freq = position width = dimensions.sel(dimension="width").item() @@ -106,7 +107,7 @@ def sample_detection_dataset() -> xr.Dataset: scores_data, coords=detection_coords, dims=["detection"], - name="score", + name="scores", ) dimensions_data = np.array([[7.0, 16.0], [3.0, 12.0]], dtype=np.float32) @@ -140,7 +141,7 @@ def sample_detection_dataset() -> xr.Dataset: ds = xr.Dataset( { - "score": scores, + "scores": scores, "dimensions": dimensions, "classes": classes, "features": features, diff --git a/tests/test_targets/test_terms.py b/tests/test_targets/test_terms.py index 8093521..37a997e 100644 --- a/tests/test_targets/test_terms.py +++ b/tests/test_targets/test_terms.py @@ -109,6 +109,7 @@ def test_get_tag_from_info_key_not_found(): def test_load_terms_from_config(tmp_path): + term_registry = TermRegistry() config_data = { "terms": [ { @@ -127,7 +128,10 @@ def test_load_terms_from_config(tmp_path): with open(config_file, "w") as f: yaml.dump(config_data, f) - loaded_terms = load_terms_from_config(config_file) + loaded_terms = load_terms_from_config( + config_file, + term_registry=term_registry, + ) assert "species" in loaded_terms assert "my_custom_term" in loaded_terms assert loaded_terms["species"].name == "dwc:scientificName"