Skip to content

Commit 495a710

Browse files
committed
tests(restapi): Updated test coverage to confirm entrypoints can be registered without queues
1 parent 429ac3d commit 495a710

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
@@ -506,6 +506,21 @@ def test_create_entrypoint(
506506
queue_ids=queue_ids,
507507
)
508508

509+
# Testing that queue_ids feild can be excluded
510+
entrypoint_response = actions.register_entrypoint(
511+
client,
512+
name="queues_not_included",
513+
description=description,
514+
group_id=group_id,
515+
task_graph=task_graph,
516+
parameters=parameters,
517+
plugin_ids=plugin_ids,
518+
)
519+
entrypoint_expected = entrypoint_response.get_json()
520+
assert_retrieving_entrypoint_by_id_works(
521+
client, entrypoint_id=entrypoint_expected["id"], expected=entrypoint_expected
522+
)
523+
509524

510525
def test_entrypoint_get_all(
511526
client: FlaskClient,

0 commit comments

Comments
 (0)