Skip to content

Commit 84b2262

Browse files
fix: test
1 parent 4c4d7c4 commit 84b2262

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

packages/models-library/src/models_library/api_schemas_long_running_tasks/tasks.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ class TaskGet(TaskBase):
5656

5757
@model_validator(mode="after")
5858
def _validate_result_hrefs(self) -> Self:
59-
if not (self.result_href or self.result_stream_href):
60-
msg = "Either result_href or result_stream_href must be set"
59+
if self.result_href and self.result_stream_href:
60+
msg = (
61+
"Either result_href or result_stream_href must be set, or none of them"
62+
)
6163
raise ValueError(msg)
6264
return self

packages/models-library/tests/test_api_schemas_long_running_tasks_tasks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def _get_data_without_task_name(task_id: str) -> dict:
77
return {
88
"task_id": task_id,
99
"status_href": "",
10-
"result_href": "http://result",
10+
"result_href": "",
1111
"abort_href": "",
1212
}
1313

@@ -33,9 +33,9 @@ def _get_data_with_task_name(task_id: str, task_name: str) -> dict:
3333
return {
3434
"task_id": task_id,
3535
"task_name": task_name,
36-
"status_href": "http://status",
37-
"result_href": "http://result",
38-
"abort_href": "http://abort",
36+
"status_href": "",
37+
"result_href": "",
38+
"abort_href": "",
3939
}
4040

4141

0 commit comments

Comments
 (0)