Skip to content

Commit

Permalink
test(restapi): Fixed test rename entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewhand committed Jun 21, 2024
1 parent 45312ed commit 24481ae
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/unit/restapi/v1/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,5 @@ def registered_entrypoints(
"entrypoint1": entrypoint1_response,
"entrypoint2": entrypoint2_response,
"entrypoint3": entrypoint3_response,
"queue": queue,
}
16 changes: 14 additions & 2 deletions tests/unit/restapi/v1/test_entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ def assert_cannot_rename_entrypoint_with_existing_name(
entrypoint_id: int,
existing_name: str,
existing_description: str,
existing_task_graph: str,
existing_parameters: list[dict[str, Any]],
existing_plugin_file_ids: list[int],
existing_queue_id: int,
) -> None:
"""Assert that renaming a entrypoint with an existing name fails.
Expand All @@ -316,6 +320,10 @@ def assert_cannot_rename_entrypoint_with_existing_name(
entrypoint_id=entrypoint_id,
new_name=existing_name,
new_description=existing_description,
new_task_graph=existing_task_graph,
new_parameters=existing_parameters,
new_plugin_file_ids=existing_plugin_file_ids,
new_queue_id=existing_queue_id,
)
assert response.status_code == 400

Expand Down Expand Up @@ -509,7 +517,7 @@ def test_rename_entrypoint(
new_task_graph=entrypoint_to_rename["taskGraph"],
new_parameters=entrypoint_to_rename["parameters"],
new_plugin_file_ids=entrypoint_to_rename["pluginFiles"],
new_queue_id=entrypoint_to_rename["queue"]["id"],
new_queue_id=registered_entrypoints["queue"]["id"],
).get_json()
assert_entrypoint_name_matches_expected_name(
client,
Expand All @@ -531,7 +539,7 @@ def test_rename_entrypoint(
new_task_graph=entrypoint_to_rename["taskGraph"],
new_parameters=entrypoint_to_rename["parameters"],
new_plugin_file_ids=entrypoint_to_rename["pluginFiles"],
new_queue_id=entrypoint_to_rename["queue"]["id"],
new_queue_id=registered_entrypoints["queue"]["id"],
).get_json()
assert_entrypoint_name_matches_expected_name(
client,
Expand All @@ -544,6 +552,10 @@ def test_rename_entrypoint(
entrypoint_id=entrypoint_to_rename["id"],
existing_name=existing_entrypoint["name"],
existing_description=entrypoint_to_rename["description"],
existing_task_graph=entrypoint_to_rename["taskGraph"],
existing_parameters=entrypoint_to_rename["parameters"],
existing_plugin_file_ids=entrypoint_to_rename["pluginFiles"],
existing_queue_id=registered_entrypoints["queue"]["id"],
)


Expand Down

0 comments on commit 24481ae

Please sign in to comment.