Skip to content

Commit af63c1c

Browse files
andrewhandjkglasbrenner
authored andcommitted
tests(restapi): Updated test coverage to confirm entrypoints can be registered without queues
1 parent 480bddc commit af63c1c

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

tests/unit/restapi/lib/actions.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def register_entrypoint(
6666
task_graph: str,
6767
parameters: list[dict[str, Any]],
6868
plugin_ids: list[int],
69-
queue_ids: list[int],
69+
queue_ids: list[int] | None = None,
7070
) -> TestResponse:
7171
"""Register an entrypoint using the API.
7272
@@ -87,9 +87,11 @@ def register_entrypoint(
8787
"taskGraph": task_graph,
8888
"parameters": parameters,
8989
"plugins": plugin_ids,
90-
"queues": queue_ids,
9190
}
9291

92+
if queue_ids:
93+
payload["queues"] = queue_ids
94+
9395
if description:
9496
payload["description"] = description
9597

tests/unit/restapi/v1/test_entrypoint.py

+15
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,21 @@ def test_create_entrypoint(
549549
queue_ids=queue_ids,
550550
)
551551

552+
# Testing that queue_ids feild can be excluded
553+
entrypoint_response = actions.register_entrypoint(
554+
client,
555+
name="queues_not_included",
556+
description=description,
557+
group_id=group_id,
558+
task_graph=task_graph,
559+
parameters=parameters,
560+
plugin_ids=plugin_ids,
561+
)
562+
entrypoint_expected = entrypoint_response.get_json()
563+
assert_retrieving_entrypoint_by_id_works(
564+
client, entrypoint_id=entrypoint_expected["id"], expected=entrypoint_expected
565+
)
566+
552567

553568
def test_entrypoint_get_all(
554569
dioptra_client: DioptraClient[DioptraResponseProtocol],

0 commit comments

Comments
 (0)