Skip to content

Commit

Permalink
Address PR Review Comments #35
Browse files Browse the repository at this point in the history
  • Loading branch information
asuresh-code committed Dec 19, 2024
1 parent aba7d2a commit d1be4a6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion object_storage_api/services/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def list(self, entity_id: Optional[str] = None, primary: Optional[bool] = None)

def update(self, image_id: str, image: ImagePatchMetadataSchema) -> ImageMetadataSchema:
"""
Update an image based by its ID.
Update an image based on its ID.
:param image_id: The ID of the image to update.
:param image: The image containing the fields to be updated.
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def patch_image(self, image_id: str, image_patch_data: dict) -> None:
Patches an image with the given ID.
:param image_id: ID of the image to be updated.
:param image_patch_data: Dictionary containing the image patch data as would be required for a
:param image_patch_data: Dictionary containing the image patch data as would be required for an
`ImagePatchSchema`.
"""
self._patch_response_image = self.test_client.patch(f"/images/{image_id}", json=image_patch_data)
Expand All @@ -329,7 +329,7 @@ def check_patch_image_success(self, expected_image_get_data: dict) -> None:
Checks that a prior call to `patch_image` gave a successful response with the expected data returned.
:param expected_image_get_data: Dictionaries containing the expected image data as would be
required for a `ImageMetadataSchema`.
required for an `ImageMetadataSchema`.
"""
assert self._patch_response_image.status_code == 200
assert self._patch_response_image.json() == expected_image_get_data
Expand Down
2 changes: 1 addition & 1 deletion test/unit/repositories/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def check_update_success(self) -> None:

def check_update_failed_with_exception(self, message: str) -> None:
"""
Checks that a prior call to `call_update_expecting_error` worked as expected, raising an exception
Checks that a prior call to `call_update_expecting_error` failed as expected, raising an exception
with the correct message.
:param message: Expected message of the raised exception.
Expand Down
8 changes: 4 additions & 4 deletions test/unit/services/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,10 @@ def mock_update(self, image_patch_data: dict, stored_image_post_data: Optional[d
Mocks the repository methods appropriately to test the `update` service method.
:param image_id: ID of the image to be updated.
:param image_patch_data: Dictionary containing the patch data as would be required for a
:param image_patch_data: Dictionary containing the patch data as would be required for an
`ImagePatchMetadataSchema` (i.e. no created and modified times required).
:param stored_image_post_data: Dictionary containing the image data for the existing stored
image as would be required for `ImagePostMetadataSchema` (i.e. no created and modified
image as would be required for an `ImagePostMetadataSchema` (i.e. no created and modified
times required).
"""
# Stored image
Expand Down Expand Up @@ -330,10 +330,10 @@ def check_update_success(self) -> None:


class TestUpdate(UpdateDSL):
"""Tests for updating a image."""
"""Tests for updating an image."""

def test_update(self):
"""Test updating all fields of a image."""
"""Test updating all fields of an image."""
image_id = str(ObjectId())

self.mock_update(
Expand Down

0 comments on commit d1be4a6

Please sign in to comment.