mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fix bug in assert_has_image_n_labels
This commit is contained in:
@@ -241,6 +241,7 @@ def _get_image_labels(
|
||||
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,
|
||||
|
||||
@@ -102,6 +102,7 @@
|
||||
<has_image_height height="32" />
|
||||
<has_image_channels channels="1" />
|
||||
<has_image_n_labels n="1" exclude_labels="0" />
|
||||
<has_image_n_labels n="0" exclude_labels="0,1" />
|
||||
<has_image_mean_object_size mean_object_size="256" exclude_labels="0" />
|
||||
</assert_contents>
|
||||
</output>
|
||||
@@ -179,4 +180,4 @@
|
||||
</output>
|
||||
</test>
|
||||
</tests>
|
||||
</tool>
|
||||
</tool>
|
||||
|
||||
Reference in New Issue
Block a user