Skip to content

Commit 4592fa9

Browse files
authored
Add more negative tests (opendatahub-io#997)
1 parent f206021 commit 4592fa9

File tree

1 file changed

+61
-5
lines changed

1 file changed

+61
-5
lines changed

tests/model_registry/model_catalog/catalog_config/test_model_catalog_negative.py

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_modify_default_catalog_configmap_reconciles(
8383
type: hf
8484
enabled: true
8585
""",
86-
"includedModels cannot be empty for HuggingFace catalog",
86+
"includedModels cannot be empty for Hugging Face catalog",
8787
id="test_hf_source_no_include_model",
8888
),
8989
pytest.param(
@@ -94,11 +94,67 @@ def test_modify_default_catalog_configmap_reconciles(
9494
type: hf
9595
enabled: true
9696
includedModels:
97-
- ibm-granite/*
97+
- abc-random*
9898
""",
99-
"HuggingFace API returned status 401",
100-
id="test_hf_source_unauthorized",
101-
marks=pytest.mark.xfail(reason="RHOAIENG-42213 is causing this failure"),
99+
'failed to expand model patterns: wildcard pattern "abc-random*" is not supported - '
100+
"Hugging Face requires a specific organization",
101+
id="test_hf_source_invalid_organization",
102+
),
103+
pytest.param(
104+
"""
105+
catalogs:
106+
- name: HuggingFace Hub
107+
id: error_catalog
108+
type: hf
109+
enabled: true
110+
includedModels:
111+
- '*'
112+
""",
113+
'failed to expand model patterns: wildcard pattern "*" is not supported - '
114+
"Hugging Face requires a specific organization",
115+
id="test_hf_source_global_wildcard",
116+
),
117+
pytest.param(
118+
"""
119+
catalogs:
120+
- name: HuggingFace Hub
121+
id: error_catalog
122+
type: hf
123+
enabled: true
124+
includedModels:
125+
- '*/*'
126+
""",
127+
'failed to expand model patterns: wildcard pattern "*/*" is not supported - '
128+
"Hugging Face requires a specific organization",
129+
id="test_hf_source_global_org_wildcard",
130+
),
131+
pytest.param(
132+
"""
133+
catalogs:
134+
- name: HuggingFace Hub
135+
id: error_catalog
136+
type: hf
137+
enabled: true
138+
includedModels:
139+
- 'RedHatAI/'
140+
""",
141+
'failed to expand model patterns: wildcard pattern "RedHatAI/" is not supported - '
142+
"Hugging Face requires a specific organization",
143+
id="test_hf_source_empty_model_name",
144+
),
145+
pytest.param(
146+
"""
147+
catalogs:
148+
- name: HuggingFace Hub
149+
id: error_catalog
150+
type: hf
151+
enabled: true
152+
includedModels:
153+
- '*RedHatAI*'
154+
""",
155+
'failed to expand model patterns: wildcard pattern "*RedHatAI*" is not supported - '
156+
"Hugging Face requires a specific organization",
157+
id="test_hf_source_multiple_wildcards",
102158
),
103159
],
104160
indirect=["updated_catalog_config_map_scope_function"],

0 commit comments

Comments
 (0)