Skip to content

Commit a4a823a

Browse files
fix: use helper function
1 parent c252a4a commit a4a823a

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

services/web/server/tests/unit/with_dbs/04/functions/test_functions_controller_rest.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ async def test_function_workflow(
162162
client,
163163
expected_list,
164164
expected_count=2,
165-
expected_uid_in_results=str(returned_function_uid),
165+
expected_uid_in_results=f"{returned_function_uid}",
166166
expected_uid_at_index=(
167-
str(returned_function_uid),
167+
f"{returned_function_uid}",
168168
1,
169169
), # ordered by modified_at by default
170170
)
@@ -175,8 +175,8 @@ async def test_function_workflow(
175175
expected_list,
176176
expected_count=2,
177177
params={"order_by": json_dumps({"field": "created_at", "direction": "asc"})},
178-
expected_uid_in_results=str(returned_function_uid),
179-
expected_uid_at_index=(str(returned_function_uid), 0),
178+
expected_uid_in_results=f"{returned_function_uid}",
179+
expected_uid_at_index=(f"{returned_function_uid}", 0),
180180
)
181181

182182
# List existing functions (searching for not existing)
@@ -196,16 +196,12 @@ async def test_function_workflow(
196196
)
197197

198198
# List existing functions (searching by title)
199-
url = client.app.router["list_functions"].url_for()
200-
response = await client.get(
201-
url, params={"filters": json_dumps({"search_by_title": "duplicate"})}
199+
await _list_functions_and_validate(
200+
client,
201+
expected_list,
202+
expected_count=1,
203+
params={"filters": json_dumps({"search_by_title": "duplicate"})},
202204
)
203-
data, error = await assert_status(response, expected_list)
204-
if not error:
205-
retrieved_functions = TypeAdapter(list[RegisteredFunctionGet]).validate_python(
206-
data
207-
)
208-
assert len(retrieved_functions) == 1
209205

210206
# Set group permissions for other user
211207
new_group_id = other_logged_user["primary_gid"]

0 commit comments

Comments
 (0)