diff --git a/services/web/server/tests/unit/with_dbs/01/folders/test_folders.py b/services/web/server/tests/unit/with_dbs/01/folders/test_folders.py index 46f2f2b559e..bb0c830ef27 100644 --- a/services/web/server/tests/unit/with_dbs/01/folders/test_folders.py +++ b/services/web/server/tests/unit/with_dbs/01/folders/test_folders.py @@ -76,7 +76,7 @@ async def test_folders_full_workflow( url = client.app.router["get_folder"].url_for( folder_id=f"{added_folder['folderId']}" ) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert FolderGet.model_validate(data) assert data["folderId"] == added_folder["folderId"] @@ -157,7 +157,7 @@ async def test_sub_folders_full_workflow( # list user specific folder base_url = client.app.router["list_folders"].url_for() url = base_url.with_query({"folder_id": f"{subfolder_folder['folderId']}"}) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 0 @@ -175,7 +175,7 @@ async def test_sub_folders_full_workflow( # list user subfolder folders base_url = client.app.router["list_folders"].url_for() url = base_url.with_query({"folder_id": f"{subfolder_folder['folderId']}"}) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 1 assert data[0]["name"] == "My sub sub folder" @@ -211,7 +211,7 @@ async def test_sub_folders_full_workflow( # list user root folders base_url = client.app.router["list_folders"].url_for() url = base_url.with_query({"folder_id": "null"}) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 2 @@ -298,7 +298,7 @@ async def test_project_listing_inside_of_private_folder( # list project in user private folder base_url = client.app.router["list_projects"].url_for() url = base_url.with_query({"folder_id": f"{original_user_folder['folderId']}"}) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 1 assert data[0]["uuid"] == user_project["uuid"] @@ -310,7 +310,7 @@ async def test_project_listing_inside_of_private_folder( # Try to list folder that user doesn't have access to base_url = client.app.router["list_projects"].url_for() url = base_url.with_query({"folder_id": f"{original_user_folder['folderId']}"}) - resp = await client.get(url) + resp = await client.get(f"{url}") _, errors = await assert_status( resp, status.HTTP_403_FORBIDDEN, @@ -330,7 +330,7 @@ async def test_project_listing_inside_of_private_folder( # list new user root folder base_url = client.app.router["list_projects"].url_for() url = base_url.with_query({"folder_id": "null"}) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 1 assert data[0]["uuid"] == user_project["uuid"] @@ -353,7 +353,7 @@ async def test_project_listing_inside_of_private_folder( # list new user specific folder base_url = client.app.router["list_projects"].url_for() url = base_url.with_query({"folder_id": f"{new_user_folder['folderId']}"}) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 1 assert data[0]["uuid"] == user_project["uuid"] @@ -448,14 +448,14 @@ async def test_folders_deletion( # list subfolder projects base_url = client.app.router["list_projects"].url_for() url = base_url.with_query({"folder_id": f"{subfolder_2['folderId']}"}) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 1 assert data[0]["uuid"] == user_project["uuid"] # list root projects base_url = client.app.router["list_projects"].url_for() - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 0 @@ -474,13 +474,13 @@ async def test_folders_deletion( await assert_status(resp, status.HTTP_204_NO_CONTENT) fire_and_forget_tasks = client.app[APP_FIRE_AND_FORGET_TASKS_KEY] - t: asyncio.Task = list(fire_and_forget_tasks)[0] + t: asyncio.Task = next(iter(fire_and_forget_tasks)) assert t.get_name().startswith("fire_and_forget_task_delete_project_task_") await t assert len(client.app[APP_FIRE_AND_FORGET_TASKS_KEY]) == 0 # list root projects (The project should have been deleted) base_url = client.app.router["list_projects"].url_for() - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 0 diff --git a/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces.py b/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces.py index 9365094d679..25de918f878 100644 --- a/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces.py +++ b/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces.py @@ -78,7 +78,7 @@ async def test_workspaces_workflow( url = client.app.router["get_workspace"].url_for( workspace_id=f"{added_workspace['workspaceId']}" ) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert data["workspaceId"] == added_workspace["workspaceId"] assert data["name"] == "My first workspace" diff --git a/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__folders_and_projects_crud.py b/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__folders_and_projects_crud.py index c95aebe6fdd..0ebb5518b28 100644 --- a/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__folders_and_projects_crud.py +++ b/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__folders_and_projects_crud.py @@ -79,7 +79,7 @@ async def test_workspaces_full_workflow_with_folders_and_projects( # List project in workspace base_url = client.app.router["list_projects"].url_for() url = base_url.with_query({"workspace_id": f"{added_workspace['workspaceId']}"}) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 1 assert data[0]["uuid"] == project["uuid"] @@ -88,7 +88,7 @@ async def test_workspaces_full_workflow_with_folders_and_projects( # Get project in workspace base_url = client.app.router["get_project"].url_for(project_id=project["uuid"]) - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert data["uuid"] == project["uuid"] assert data["workspaceId"] == added_workspace["workspaceId"] @@ -110,7 +110,7 @@ async def test_workspaces_full_workflow_with_folders_and_projects( url = base_url.with_query( {"workspace_id": f"{added_workspace['workspaceId']}", "folder_id": "null"} ) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 1 assert data[0]["folderId"] == first_folder["folderId"] @@ -131,7 +131,7 @@ async def test_workspaces_full_workflow_with_folders_and_projects( "folder_id": f"{first_folder['folderId']}", } ) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 1 assert data[0]["uuid"] == project["uuid"] @@ -142,7 +142,7 @@ async def test_workspaces_full_workflow_with_folders_and_projects( # Try to list folder that user doesn't have access to base_url = client.app.router["list_projects"].url_for() url = base_url.with_query({"workspace_id": f"{added_workspace['workspaceId']}"}) - resp = await client.get(url) + resp = await client.get(f"{url}") _, errors = await assert_status( resp, status.HTTP_403_FORBIDDEN, @@ -164,7 +164,7 @@ async def test_workspaces_full_workflow_with_folders_and_projects( url = base_url.with_query( {"workspace_id": f"{added_workspace['workspaceId']}", "folder_id": "null"} ) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 1 @@ -176,7 +176,7 @@ async def test_workspaces_full_workflow_with_folders_and_projects( "folder_id": "none", } ) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 0 @@ -188,7 +188,7 @@ async def test_workspaces_full_workflow_with_folders_and_projects( "folder_id": f"{first_folder['folderId']}", } ) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 1 assert data[0]["uuid"] == project["uuid"] @@ -230,7 +230,7 @@ async def test_workspaces_full_workflow_with_folders_and_projects( url = base_url.with_query( {"workspace_id": f"{added_workspace['workspaceId']}", "folder_id": "null"} ) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 2 @@ -299,7 +299,7 @@ async def test_workspaces_delete_folders( # List project in workspace base_url = client.app.router["list_projects"].url_for() url = base_url.with_query({"workspace_id": f"{added_workspace['workspaceId']}"}) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 2 @@ -362,6 +362,7 @@ async def test_workspaces_delete_folders( # List project in workspace (The projects should have been deleted) base_url = client.app.router["list_projects"].url_for() url = base_url.with_query({"workspace_id": f"{added_workspace['workspaceId']}"}) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 0 + diff --git a/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__list_projects_full_search.py b/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__list_projects_full_search.py index a7efd64b485..6c146bb5a1f 100644 --- a/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__list_projects_full_search.py +++ b/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__list_projects_full_search.py @@ -82,7 +82,7 @@ async def test_workspaces__list_projects_full_search( # List project with full search base_url = client.app.router["list_projects_full_search"].url_for() url = base_url.with_query({"text": "solution"}) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 1 assert data[0]["uuid"] == project_1["uuid"] @@ -104,7 +104,7 @@ async def test_workspaces__list_projects_full_search( # List project with full search base_url = client.app.router["list_projects_full_search"].url_for() url = base_url.with_query({"text": "Orion"}) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 1 assert data[0]["uuid"] == project_2["uuid"] @@ -137,7 +137,7 @@ async def test_workspaces__list_projects_full_search( # List project with full search base_url = client.app.router["list_projects_full_search"].url_for() url = base_url.with_query({"text": "Skyline"}) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 1 assert data[0]["uuid"] == project_3["uuid"] @@ -147,7 +147,7 @@ async def test_workspaces__list_projects_full_search( # List project with full search (it should return data across all workspaces/folders) base_url = client.app.router["list_projects_full_search"].url_for() url = base_url.with_query({"text": "solution"}) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) sorted_data = sorted(data, key=lambda x: x["uuid"]) assert len(sorted_data) == 3 @@ -190,7 +190,7 @@ async def test__list_projects_full_search_with_query_parameters( # Full search with text base_url = client.app.router["list_projects_full_search"].url_for() url = base_url.with_query({"text": "Orion"}) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 1 assert data[0]["uuid"] == project["uuid"] @@ -203,7 +203,7 @@ async def test__list_projects_full_search_with_query_parameters( "order_by": json.dumps({"field": "uuid", "direction": "desc"}), } ) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 1 assert data[0]["uuid"] == project["uuid"] @@ -211,7 +211,7 @@ async def test__list_projects_full_search_with_query_parameters( # Full search with tag_ids base_url = client.app.router["list_projects_full_search"].url_for() url = base_url.with_query({"text": "Orion", "tag_ids": "1,2"}) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 0 @@ -232,7 +232,7 @@ async def test__list_projects_full_search_with_query_parameters( # Full search with tag_ids base_url = client.app.router["list_projects_full_search"].url_for() url = base_url.with_query({"text": "Orion", "tag_ids": f"{added_tag['id']}"}) - resp = await client.get(url) + resp = await client.get(f"{url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 1 assert data[0]["uuid"] == project["uuid"] diff --git a/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__moving_projects_between_workspaces.py b/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__moving_projects_between_workspaces.py index f583b9e3ecf..21b16ea9738 100644 --- a/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__moving_projects_between_workspaces.py +++ b/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__moving_projects_between_workspaces.py @@ -58,7 +58,7 @@ async def test_moving_between_workspaces_user_role_permissions( base_url = client.app.router["replace_project_workspace"].url_for( project_id=fake_project["uuid"], workspace_id="null" ) - resp = await client.put(base_url) + resp = await client.put(f"{base_url}") await assert_status(resp, expected.no_content) @@ -98,7 +98,7 @@ async def test_moving_between_private_and_shared_workspaces( # Get project in workspace base_url = client.app.router["get_project"].url_for(project_id=project["uuid"]) - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert data["workspaceId"] == added_workspace["workspaceId"] # <-- Workspace ID @@ -106,12 +106,12 @@ async def test_moving_between_private_and_shared_workspaces( base_url = client.app.router["replace_project_workspace"].url_for( project_id=project["uuid"], workspace_id="null" ) - resp = await client.put(base_url) + resp = await client.put(f"{base_url}") await assert_status(resp, status.HTTP_204_NO_CONTENT) # Get project in workspace base_url = client.app.router["get_project"].url_for(project_id=project["uuid"]) - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert data["workspaceId"] is None # <-- Workspace ID is None @@ -119,12 +119,12 @@ async def test_moving_between_private_and_shared_workspaces( base_url = client.app.router["replace_project_workspace"].url_for( project_id=project["uuid"], workspace_id=f"{added_workspace['workspaceId']}" ) - resp = await client.put(base_url) + resp = await client.put(f"{base_url}") await assert_status(resp, status.HTTP_204_NO_CONTENT) # Get project in workspace base_url = client.app.router["get_project"].url_for(project_id=project["uuid"]) - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert data["workspaceId"] == added_workspace["workspaceId"] # <-- Workspace ID @@ -177,7 +177,7 @@ async def test_moving_between_shared_and_shared_workspaces( # Get project in workspace base_url = client.app.router["get_project"].url_for(project_id=project["uuid"]) - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert data["workspaceId"] == added_workspace["workspaceId"] # <-- Workspace ID @@ -185,12 +185,12 @@ async def test_moving_between_shared_and_shared_workspaces( base_url = client.app.router["replace_project_workspace"].url_for( project_id=project["uuid"], workspace_id=f"{second_workspace['workspaceId']}" ) - resp = await client.put(base_url) + resp = await client.put(f"{base_url}") await assert_status(resp, status.HTTP_204_NO_CONTENT) # Get project in workspace base_url = client.app.router["get_project"].url_for(project_id=project["uuid"]) - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert data["workspaceId"] == second_workspace["workspaceId"] # <-- Workspace ID @@ -257,7 +257,7 @@ async def test_moving_between_workspaces_check_removed_from_folder( # Get project in workspace base_url = client.app.router["get_project"].url_for(project_id=project["uuid"]) - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert data["workspaceId"] == added_workspace["workspaceId"] # <-- Workspace ID @@ -265,12 +265,12 @@ async def test_moving_between_workspaces_check_removed_from_folder( base_url = client.app.router["replace_project_workspace"].url_for( project_id=project["uuid"], workspace_id="none" ) - resp = await client.put(base_url) + resp = await client.put(f"{base_url}") await assert_status(resp, status.HTTP_204_NO_CONTENT) # Get project in workspace base_url = client.app.router["get_project"].url_for(project_id=project["uuid"]) - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") data, _ = await assert_status(resp, status.HTTP_200_OK) assert data["workspaceId"] is None # <-- Workspace ID is None diff --git a/services/web/server/tests/unit/with_dbs/02/conftest.py b/services/web/server/tests/unit/with_dbs/02/conftest.py index 33257ef2026..7e765694d3d 100644 --- a/services/web/server/tests/unit/with_dbs/02/conftest.py +++ b/services/web/server/tests/unit/with_dbs/02/conftest.py @@ -254,7 +254,7 @@ async def _assert_it( ) -> dict: # GET /v0/projects/{project_id} with a project owned by user url = client.app.router["get_project"].url_for(project_id=project["uuid"]) - resp = await client.get(url) + resp = await client.get(f"{url}") data, error = await assert_status(resp, expected) if not error: diff --git a/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__clone_in_workspace_and_folder.py b/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__clone_in_workspace_and_folder.py index 755a1081fcb..18ba745eaee 100644 --- a/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__clone_in_workspace_and_folder.py +++ b/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__clone_in_workspace_and_folder.py @@ -114,7 +114,7 @@ async def test_clone_project( "folder_id": f"{create_workspace_and_folder[1]}", } url = base_url.with_query(**query_parameters) - resp = await client.get(url) + resp = await client.get(f"{url}") data = await resp.json() assert resp.status == 200 assert len(data["data"]) == 1 @@ -135,7 +135,7 @@ async def test_clone_project( "folder_id": f"{create_workspace_and_folder[1]}", } url = base_url.with_query(**query_parameters) - resp = await client.get(url) + resp = await client.get(f"{url}") data = await resp.json() assert resp.status == 200 assert len(data["data"]) == 2 diff --git a/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__list.py b/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__list.py index dae689d1974..e5f580cd785 100644 --- a/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__list.py +++ b/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__list.py @@ -55,7 +55,7 @@ async def _list_projects( if query_parameters: url = url.with_query(**query_parameters) - resp = await client.get(url) + resp = await client.get(f"{url}") data, errors, meta, links = await assert_status( resp, expected, diff --git a/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__list_with_query_params.py b/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__list_with_query_params.py index 89b7fed1544..abb26a3f3e3 100644 --- a/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__list_with_query_params.py +++ b/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__list_with_query_params.py @@ -153,7 +153,7 @@ async def test_list_projects_with_search_parameter( base_url = client.app.router["list_projects"].url_for() assert f"{base_url}" == f"/{api_version_prefix}/projects" - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") data = await resp.json() assert resp.status == 200 @@ -164,7 +164,7 @@ async def test_list_projects_with_search_parameter( url = base_url.with_query(**query_parameters) assert f"{url}" == f"/{api_version_prefix}/projects?search=" - resp = await client.get(url) + resp = await client.get(f"{url}") data = await resp.json() assert resp.status == 200 @@ -175,7 +175,7 @@ async def test_list_projects_with_search_parameter( url = base_url.with_query(**query_parameters) assert f"{url}" == f"/{api_version_prefix}/projects?search=nAmE+5" - resp = await client.get(url) + resp = await client.get(f"{url}") data = await resp.json() assert resp.status == 200 @@ -188,7 +188,7 @@ async def test_list_projects_with_search_parameter( url = base_url.with_query(**query_parameters) assert f"{url}" == f"/{api_version_prefix}/projects?search=2-fe1b-11ed-b038-cdb1" - resp = await client.get(url) + resp = await client.get(f"{url}") data = await resp.json() assert resp.status == 200 @@ -207,7 +207,7 @@ async def test_list_projects_with_search_parameter( == f"/{api_version_prefix}/projects?search={user_name_substring_query_parsed}" ) - resp = await client.get(url) + resp = await client.get(f"{url}") data = await resp.json() assert resp.status == 200 @@ -225,7 +225,7 @@ async def test_list_projects_with_search_parameter( url = base_url.with_query(**query_parameters) assert f"{url}" == f"/{api_version_prefix}/projects?search=oda" - resp = await client.get(url) + resp = await client.get(f"{url}") data = await resp.json() assert resp.status == 200 @@ -236,7 +236,7 @@ async def test_list_projects_with_search_parameter( url = base_url.with_query(**query_parameters) assert f"{url}" == f"/{api_version_prefix}/projects?search=does+not+exists" - resp = await client.get(url) + resp = await client.get(f"{url}") data = await resp.json() assert resp.status == 200 @@ -249,7 +249,7 @@ async def test_list_projects_with_search_parameter( url = base_url.with_query(**query_parameters) assert f"{url}" == f"/{api_version_prefix}/projects?search=oda&offset=0&limit=1" - resp = await client.get(url) + resp = await client.get(f"{url}") data = await resp.json() assert resp.status == 200 @@ -327,7 +327,7 @@ async def test_list_projects_with_order_by_parameter( f"{url}" == f"/{api_version_prefix}/projects?order_by=%7B%22field%22:+%22uuid%22,+%22direction%22:+%22asc%22%7D" ) - resp = await client.get(url) + resp = await client.get(f"{url}") data = await resp.json() assert resp.status == 200 assert [item["uuid"][0] for item in data["data"]] == _alphabetically_ordered_list @@ -337,7 +337,7 @@ async def test_list_projects_with_order_by_parameter( url = base_url.with_query( order_by=json.dumps({"field": "uuid", "direction": "desc"}) ) - resp = await client.get(url) + resp = await client.get(f"{url}") data = await resp.json() assert resp.status == 200 assert [item["uuid"][0] for item in data["data"]] == _alphabetically_ordered_list[ @@ -349,7 +349,7 @@ async def test_list_projects_with_order_by_parameter( url = base_url.with_query( order_by=json.dumps({"field": "name", "direction": "asc"}) ) - resp = await client.get(url) + resp = await client.get(f"{url}") data = await resp.json() assert resp.status == 200 assert [item["name"][0] for item in data["data"]] == _alphabetically_ordered_list @@ -359,7 +359,7 @@ async def test_list_projects_with_order_by_parameter( url = base_url.with_query( order_by=json.dumps({"field": "description", "direction": "asc"}) ) - resp = await client.get(url) + resp = await client.get(f"{url}") data = await resp.json() assert resp.status == 200 assert [ @@ -453,7 +453,7 @@ async def test_list_projects_for_specific_folder_id( base_url = client.app.router["list_projects"].url_for() assert f"{base_url}" == f"/{api_version_prefix}/projects" - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") data = await resp.json() assert resp.status == 200 @@ -463,7 +463,7 @@ async def test_list_projects_for_specific_folder_id( query_parameters = {"folder_id": "null"} url = base_url.with_query(**query_parameters) - resp = await client.get(url) + resp = await client.get(f"{url}") data = await resp.json() assert resp.status == 200 @@ -476,7 +476,7 @@ async def test_list_projects_for_specific_folder_id( url = base_url.with_query(**query_parameters) assert f"{url}" == f"/{api_version_prefix}/projects?folder_id={setup_folders_db}" - resp = await client.get(url) + resp = await client.get(f"{url}") data = await resp.json() assert resp.status == 200 diff --git a/services/web/server/tests/unit/with_dbs/02/test_projects_nodes_pricing_unit_handlers.py b/services/web/server/tests/unit/with_dbs/02/test_projects_nodes_pricing_unit_handlers.py index 10367ac9155..a867d2e3c40 100644 --- a/services/web/server/tests/unit/with_dbs/02/test_projects_nodes_pricing_unit_handlers.py +++ b/services/web/server/tests/unit/with_dbs/02/test_projects_nodes_pricing_unit_handlers.py @@ -52,7 +52,7 @@ async def test_project_node_pricing_unit_user_role_access( base_url = client.app.router["get_project_node_pricing_unit"].url_for( project_id=user_project["uuid"], node_id=node_id ) - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") assert ( resp.status == status.HTTP_401_UNAUTHORIZED if user_role == UserRole.ANONYMOUS @@ -71,7 +71,7 @@ async def test_project_node_pricing_unit_user_project_access( base_url = client.app.router["get_project_node_pricing_unit"].url_for( project_id=user_project["uuid"], node_id=node_id ) - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") data, _ = await assert_status(resp, expected) assert data == None @@ -80,7 +80,7 @@ async def test_project_node_pricing_unit_user_project_access( base_url = client.app.router["get_project_node_pricing_unit"].url_for( project_id=user_project["uuid"], node_id=node_id ) - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") _, errors = await assert_status(resp, status.HTTP_403_FORBIDDEN) assert errors diff --git a/services/web/server/tests/unit/with_dbs/02/test_projects_wallet_handlers.py b/services/web/server/tests/unit/with_dbs/02/test_projects_wallet_handlers.py index 269358a4a9f..30aaa89abbc 100644 --- a/services/web/server/tests/unit/with_dbs/02/test_projects_wallet_handlers.py +++ b/services/web/server/tests/unit/with_dbs/02/test_projects_wallet_handlers.py @@ -42,7 +42,7 @@ async def test_project_wallets_user_role_access( base_url = client.app.router["get_project_wallet"].url_for( project_id=user_project["uuid"] ) - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") assert ( resp.status == status.HTTP_401_UNAUTHORIZED if user_role == UserRole.ANONYMOUS @@ -61,7 +61,7 @@ async def test_project_wallets_user_project_access( base_url = client.app.router["get_project_wallet"].url_for( project_id=user_project["uuid"] ) - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") data, _ = await assert_status(resp, expected) assert data == None @@ -70,7 +70,7 @@ async def test_project_wallets_user_project_access( base_url = client.app.router["get_project_wallet"].url_for( project_id=user_project["uuid"] ) - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") _, errors = await assert_status(resp, status.HTTP_403_FORBIDDEN) assert errors @@ -110,7 +110,7 @@ async def test_project_wallets_full_workflow( base_url = client.app.router["get_project_wallet"].url_for( project_id=user_project["uuid"] ) - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") data, _ = await assert_status(resp, expected) assert data == None @@ -118,14 +118,14 @@ async def test_project_wallets_full_workflow( base_url = client.app.router["connect_wallet_to_project"].url_for( project_id=user_project["uuid"], wallet_id=f"{setup_wallets_db[0].wallet_id}" ) - resp = await client.put(base_url) + resp = await client.put(f"{base_url}") data, _ = await assert_status(resp, expected) assert data["walletId"] == setup_wallets_db[0].wallet_id base_url = client.app.router["get_project_wallet"].url_for( project_id=user_project["uuid"] ) - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") data, _ = await assert_status(resp, expected) assert data["walletId"] == setup_wallets_db[0].wallet_id @@ -133,13 +133,13 @@ async def test_project_wallets_full_workflow( base_url = client.app.router["connect_wallet_to_project"].url_for( project_id=user_project["uuid"], wallet_id=f"{setup_wallets_db[1].wallet_id}" ) - resp = await client.put(base_url) + resp = await client.put(f"{base_url}") data, _ = await assert_status(resp, expected) assert data["walletId"] == setup_wallets_db[1].wallet_id base_url = client.app.router["get_project_wallet"].url_for( project_id=user_project["uuid"] ) - resp = await client.get(base_url) + resp = await client.get(f"{base_url}") data, _ = await assert_status(resp, expected) assert data["walletId"] == setup_wallets_db[1].wallet_id diff --git a/services/web/server/tests/unit/with_dbs/03/login/test_login_2fa.py b/services/web/server/tests/unit/with_dbs/03/login/test_login_2fa.py index 5cb85785419..29324b2af23 100644 --- a/services/web/server/tests/unit/with_dbs/03/login/test_login_2fa.py +++ b/services/web/server/tests/unit/with_dbs/03/login/test_login_2fa.py @@ -148,7 +148,7 @@ def _get_confirmation_link_from_email(): url = _get_confirmation_link_from_email() # 2. confirmation - response = await client.get(url) + response = await client.get(f"{url}") assert response.status == status.HTTP_200_OK # check email+password registered