Skip to content

Commit 612bf71

Browse files
add handler tests
1 parent 07feacb commit 612bf71

File tree

2 files changed

+44
-6
lines changed

2 files changed

+44
-6
lines changed

tests/unitary/with_extras/aqua/test_deployment_handler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class TestDataset:
2929
"model_id": "ocid1.datasciencemodel.oc1.iad.<OCID>",
3030
"instance_shape": "VM.GPU.A10.1",
3131
"display_name": "test-deployment-name",
32+
"freeform_tags": {"ftag1": "fvalue1", "ftag2": "fvalue2"},
33+
"defined_tags": {"dtag1": "dvalue1", "dtag2": "dvalue2"},
3234
}
3335
inference_request = {
3436
"prompt": "What is 1+1?",
@@ -156,6 +158,8 @@ def test_post(self, mock_create):
156158
private_endpoint_id=None,
157159
container_image_uri=None,
158160
cmd_var=None,
161+
freeform_tags=TestDataset.deployment_request["freeform_tags"],
162+
defined_tags=TestDataset.deployment_request["defined_tags"],
159163
)
160164

161165

tests/unitary/with_extras/aqua/test_model_handler.py

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,38 @@ def test_list(self, mock_list):
132132

133133
@parameterized.expand(
134134
[
135-
(None, None, False, None, None, None),
136-
("odsc-llm-fine-tuning", None, False, None, None, ["test.json"]),
137-
(None, "test.gguf", True, None, ["*.json"], None),
138-
(None, None, True, "iad.ocir.io/<namespace>/<image>:<tag>", ["*.json"], ["test.json"]),
135+
(None, None, False, None, None, None, None, None),
136+
(
137+
"odsc-llm-fine-tuning",
138+
None,
139+
False,
140+
None,
141+
None,
142+
["test.json"],
143+
None,
144+
None,
145+
),
146+
(None, "test.gguf", True, None, ["*.json"], None, None, None),
147+
(
148+
None,
149+
None,
150+
True,
151+
"iad.ocir.io/<namespace>/<image>:<tag>",
152+
["*.json"],
153+
["test.json"],
154+
None,
155+
None,
156+
),
157+
(
158+
None,
159+
None,
160+
False,
161+
None,
162+
None,
163+
None,
164+
{"ftag1": "fvalue1"},
165+
{"dtag1": "dvalue1"},
166+
),
139167
],
140168
)
141169
@patch("notebook.base.handlers.APIHandler.finish")
@@ -148,6 +176,8 @@ def test_register(
148176
inference_container_uri,
149177
allow_patterns,
150178
ignore_patterns,
179+
freeform_tags,
180+
defined_tags,
151181
mock_register,
152182
mock_finish,
153183
):
@@ -168,7 +198,9 @@ def test_register(
168198
download_from_hf=download_from_hf,
169199
inference_container_uri=inference_container_uri,
170200
allow_patterns=allow_patterns,
171-
ignore_patterns=ignore_patterns
201+
ignore_patterns=ignore_patterns,
202+
freeform_tags=freeform_tags,
203+
defined_tags=defined_tags,
172204
)
173205
)
174206
result = self.model_handler.post()
@@ -183,7 +215,9 @@ def test_register(
183215
download_from_hf=download_from_hf,
184216
inference_container_uri=inference_container_uri,
185217
allow_patterns=allow_patterns,
186-
ignore_patterns=ignore_patterns
218+
ignore_patterns=ignore_patterns,
219+
freeform_tags=freeform_tags,
220+
defined_tags=defined_tags,
187221
)
188222
assert result["id"] == "test_id"
189223
assert result["inference_container"] == "odsc-tgi-serving"

0 commit comments

Comments
 (0)