Skip to content

Commit

Permalink
Ruff format.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysrevans3 committed Aug 21, 2024
1 parent 5f2b4fa commit 010e2cb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ def register_update_collection(self):
response_model_exclude_unset=True,
response_model_exclude_none=True,
methods=["PUT"],
endpoint=create_async_endpoint(
self.client.update_collection, PutCollection
),
endpoint=create_async_endpoint(self.client.update_collection, PutCollection),
)

def register_patch_collection(self):
Expand Down Expand Up @@ -233,9 +231,7 @@ def register_delete_collection(self):
response_model_exclude_unset=True,
response_model_exclude_none=True,
methods=["DELETE"],
endpoint=create_async_endpoint(
self.client.delete_collection, CollectionUri
),
endpoint=create_async_endpoint(self.client.delete_collection, CollectionUri),
)

def register(self, app: FastAPI) -> None:
Expand Down
12 changes: 3 additions & 9 deletions stac_fastapi/extensions/tests/test_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ def test_merge_patch_item(client: TestClient, item: Item) -> None:


def test_json_patch_item(client: TestClient) -> None:
operations = [
{"op": "add", "path": "properties.new_prop", "value": "new_prop_value"}
]
operations = [{"op": "add", "path": "properties.new_prop", "value": "new_prop_value"}]
headers = {"Content-Type": "application/json-patch+json"}
response = client.patch(
"/collections/a-collection/items/an-item",
Expand Down Expand Up @@ -191,9 +189,7 @@ def test_merge_patch_collection(client: TestClient, collection: Collection) -> N


def test_json_patch_collection(client: TestClient) -> None:
operations = [
{"op": "add", "path": "summaries.new_prop", "value": "new_prop_value"}
]
operations = [{"op": "add", "path": "summaries.new_prop", "value": "new_prop_value"}]
headers = {"Content-Type": "application/json-patch+json"}
response = client.patch(
"/collections/a-collection/items/an-item",
Expand Down Expand Up @@ -273,9 +269,7 @@ def collection() -> Collection:
"description": "A test collection",
"extent": {
"spatial": {"bbox": [[-180, -90, 180, 90]]},
"temporal": {
"interval": [["2000-01-01T00:00:00Z", "2024-01-01T00:00:00Z"]]
},
"temporal": {"interval": [["2000-01-01T00:00:00Z", "2024-01-01T00:00:00Z"]]},
},
"links": [],
"assets": {},
Expand Down
16 changes: 4 additions & 12 deletions stac_fastapi/types/stac_fastapi/types/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ def patch_item(
)

else:
raise NotImplementedError(
"Content-Type and body combination not implemented"
)
raise NotImplementedError("Content-Type and body combination not implemented")

@abc.abstractmethod
def merge_patch_item(
Expand Down Expand Up @@ -253,9 +251,7 @@ def patch_collection(
return self.merge_patch_collection(collection_id, patch, **kwargs)

else:
raise NotImplementedError(
"Content-Type and body combination not implemented"
)
raise NotImplementedError("Content-Type and body combination not implemented")

@abc.abstractmethod
def merge_patch_collection(
Expand Down Expand Up @@ -398,9 +394,7 @@ def patch_item(
)

else:
raise NotImplementedError(
"Content-Type and body combination not implemented"
)
raise NotImplementedError("Content-Type and body combination not implemented")

@abc.abstractmethod
def merge_patch_item(
Expand Down Expand Up @@ -528,9 +522,7 @@ def patch_collection(
return self.merge_patch_collection(collection_id, patch, **kwargs)

else:
raise NotImplementedError(
"Content-Type and body combination not implemented"
)
raise NotImplementedError("Content-Type and body combination not implemented")

@abc.abstractmethod
def merge_patch_collection(
Expand Down

0 comments on commit 010e2cb

Please sign in to comment.