From fc67b20444b90fb031fa04532647ffaceb2ab469 Mon Sep 17 00:00:00 2001 From: Leonid Kostrykin Date: Fri, 15 Mar 2024 14:16:06 +0100 Subject: [PATCH] Fix bug in `assert_has_image_n_labels` --- lib/galaxy/tool_util/verify/asserts/image.py | 3 ++- test/functional/tools/validation_image.xml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/tool_util/verify/asserts/image.py b/lib/galaxy/tool_util/verify/asserts/image.py index ec5fb01d52da..f0fbc6e8326e 100644 --- a/lib/galaxy/tool_util/verify/asserts/image.py +++ b/lib/galaxy/tool_util/verify/asserts/image.py @@ -241,6 +241,7 @@ def cast_label(label): def assert_has_image_n_labels( output_bytes: bytes, channel: Optional[Union[int, str]] = None, + labels: Optional[Union[str, List[int]]] = None, exclude_labels: Optional[Union[str, List[int]]] = None, n: Optional[Union[int, str]] = None, delta: Union[int, str] = 0, @@ -251,7 +252,7 @@ def assert_has_image_n_labels( """ Asserts the specified output is an image and has the specified number of unique values (e.g., uniquely labeled objects). """ - present_labels = _get_image_labels(output_bytes, channel, exclude_labels)[1] + present_labels = _get_image_labels(output_bytes, channel, labels, exclude_labels)[1] _assert_number( len(present_labels), n, diff --git a/test/functional/tools/validation_image.xml b/test/functional/tools/validation_image.xml index 852e78191a12..a1a7791fa6ec 100644 --- a/test/functional/tools/validation_image.xml +++ b/test/functional/tools/validation_image.xml @@ -102,6 +102,7 @@ + @@ -179,4 +180,4 @@ - \ No newline at end of file +