Skip to content

Commit

Permalink
fixed issues as per ruff (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnaglodha authored Aug 25, 2024
1 parent ab85507 commit e11eff7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/geoserverx/_async/gsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/geoserverx/_sync/gsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions src/geoserverx/models/coverages_layer.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
3 changes: 1 addition & 2 deletions src/geoserverx/models/featuretypes_layer.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/_async/test_gsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit e11eff7

Please sign in to comment.