Skip to content

Commit

Permalink
tests(restapi): Updated test coverage to confirm entrypoints can be r…
Browse files Browse the repository at this point in the history
…egistered without queues
  • Loading branch information
andrewhand authored and jkglasbrenner committed Jan 13, 2025
1 parent 480bddc commit af63c1c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/unit/restapi/lib/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def register_entrypoint(
task_graph: str,
parameters: list[dict[str, Any]],
plugin_ids: list[int],
queue_ids: list[int],
queue_ids: list[int] | None = None,
) -> TestResponse:
"""Register an entrypoint using the API.
Expand All @@ -87,9 +87,11 @@ def register_entrypoint(
"taskGraph": task_graph,
"parameters": parameters,
"plugins": plugin_ids,
"queues": queue_ids,
}

if queue_ids:
payload["queues"] = queue_ids

if description:
payload["description"] = description

Expand Down
15 changes: 15 additions & 0 deletions tests/unit/restapi/v1/test_entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,21 @@ def test_create_entrypoint(
queue_ids=queue_ids,
)

# Testing that queue_ids feild can be excluded
entrypoint_response = actions.register_entrypoint(
client,
name="queues_not_included",
description=description,
group_id=group_id,
task_graph=task_graph,
parameters=parameters,
plugin_ids=plugin_ids,
)
entrypoint_expected = entrypoint_response.get_json()
assert_retrieving_entrypoint_by_id_works(
client, entrypoint_id=entrypoint_expected["id"], expected=entrypoint_expected
)


def test_entrypoint_get_all(
dioptra_client: DioptraClient[DioptraResponseProtocol],
Expand Down

0 comments on commit af63c1c

Please sign in to comment.