From e11eff7de59e67e4ab9291f7174c73a32bebdbbe Mon Sep 17 00:00:00 2001 From: Krishna Lodha <47075664+krishnaglodha@users.noreply.github.com> Date: Sun, 25 Aug 2024 17:10:22 +0530 Subject: [PATCH] fixed issues as per ruff (#57) --- src/geoserverx/_async/gsx.py | 2 +- src/geoserverx/_sync/gsx.py | 2 +- src/geoserverx/models/coverages_layer.py | 3 +-- src/geoserverx/models/featuretypes_layer.py | 3 +-- tests/_async/test_gsx.py | 4 ++-- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/geoserverx/_async/gsx.py b/src/geoserverx/_async/gsx.py index 9bd1d0a..86e35c1 100644 --- a/src/geoserverx/_async/gsx.py +++ b/src/geoserverx/_async/gsx.py @@ -301,7 +301,7 @@ async def get_all_layer_groups(self,workspace: Optional[str] = None) -> Union[La if workspace: responses = await Client.get(f"workspaces/{workspace}/layergroups") else : - responses = await Client.get(f"layergroups") + responses = await Client.get("layergroups") if responses.status_code == 200: return LayerGroupsModel.model_validate(responses.json()) else: diff --git a/src/geoserverx/_sync/gsx.py b/src/geoserverx/_sync/gsx.py index b58bbe5..410cd60 100644 --- a/src/geoserverx/_sync/gsx.py +++ b/src/geoserverx/_sync/gsx.py @@ -426,7 +426,7 @@ def get_all_layer_groups(self,workspace: Optional[str] = None) -> Union[LayerGro if workspace: responses = Client.get(f"workspaces/{workspace}/layergroups") else : - responses = Client.get(f"layergroups") + responses = Client.get("layergroups") if responses.status_code == 200: return LayerGroupsModel.model_validate(responses.json()) else: diff --git a/src/geoserverx/models/coverages_layer.py b/src/geoserverx/models/coverages_layer.py index 4fd4767..e124cd8 100644 --- a/src/geoserverx/models/coverages_layer.py +++ b/src/geoserverx/models/coverages_layer.py @@ -1,5 +1,4 @@ -from enum import Enum -from typing import Any, List, Optional,Union +from typing import List, Optional,Union from pydantic import BaseModel, Field diff --git a/src/geoserverx/models/featuretypes_layer.py b/src/geoserverx/models/featuretypes_layer.py index 3d96b69..d7da2b8 100644 --- a/src/geoserverx/models/featuretypes_layer.py +++ b/src/geoserverx/models/featuretypes_layer.py @@ -1,6 +1,5 @@ -from enum import Enum -from typing import Any, List, Optional, Dict, Union +from typing import List, Optional, Union from pydantic import BaseModel, Field diff --git a/tests/_async/test_gsx.py b/tests/_async/test_gsx.py index 5acc99c..9529a92 100644 --- a/tests/_async/test_gsx.py +++ b/tests/_async/test_gsx.py @@ -436,7 +436,7 @@ async def test_get_layer_NetworkError(create_a_client, respx_mock): # Test - get_all_layer_groups @pytest.mark.asyncio async def test_get_all_layer_groups_validation( - create_a_client, respx_mock, bad_layer_groups_connection, event_loop + create_a_client, respx_mock, bad_layer_groups_connection ): respx_mock.get(f"{baseUrl}workspaces/ne/layergroups").mock( return_value=httpx.Response(404, json=bad_layer_groups_connection) @@ -447,7 +447,7 @@ async def test_get_all_layer_groups_validation( @pytest.mark.asyncio async def test_get_all_layer_groups_success( - create_a_client, respx_mock, good_layer_groups_connection, event_loop + create_a_client, respx_mock, good_layer_groups_connection ): respx_mock.get(f"{baseUrl}workspaces/ne/layergroups").mock( return_value=httpx.Response(200, json=good_layer_groups_connection)