Skip to content

Commit 0a18244

Browse files
authored
Merge branch 'main' into feature/maas-subscription-additional-test
2 parents c24c6a7 + 15b5606 commit 0a18244

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/model_registry/model_catalog/search/test_model_search.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ def test_search_model_catalog_source_label(
5959
)["size"]
6060
LOGGER.info(f"no_filtered_models_size: {no_filtered_models_size}")
6161
assert no_filtered_models_size > 0
62-
assert no_filtered_models_size == both_filtered_models_size
62+
# no_filtered includes models from sources without labels (e.g. Other Models),
63+
# which cannot be queried via sourceLabel, so total >= labeled sum
64+
assert no_filtered_models_size >= both_filtered_models_size
6365
assert redhat_ai_filter_moldels_size + redhat_ai_validated_filter_models_size == both_filtered_models_size
6466

6567
@pytest.mark.tier3
@@ -72,6 +74,7 @@ def test_search_model_catalog_invalid_source_label(
7274
Validate search model catalog by invalid source label
7375
"""
7476

77+
# "null" is a valid source label for sources without explicit labels (e.g. Other Models)
7578
null_size = get_models_from_catalog_api(
7679
model_catalog_rest_url=model_catalog_rest_url,
7780
model_registry_rest_headers=model_registry_rest_headers,
@@ -84,9 +87,8 @@ def test_search_model_catalog_invalid_source_label(
8487
source_label="invalid",
8588
)["size"]
8689

87-
assert null_size == invalid_size == 0, (
88-
"Expected 0 models for null and invalid source label found {null_size} and {invalid_size}"
89-
)
90+
assert null_size >= 0, f"Expected non-negative size for null source label, got {null_size}"
91+
assert invalid_size == 0, f"Expected 0 models for invalid source label, got {invalid_size}"
9092

9193
@pytest.mark.parametrize(
9294
"randomly_picked_model_from_catalog_api_by_source,source_filter",

0 commit comments

Comments
 (0)