Skip to content

Commit

Permalink
Remove default value for mock_get method #104
Browse files Browse the repository at this point in the history
  • Loading branch information
VKTB committed Feb 13, 2025
1 parent 4c2ff32 commit 7d5826f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/unit/repositories/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class GetDSL(ImageRepoDSL):
_obtained_image_out: ImageOut
_get_exception: pytest.ExceptionInfo

def mock_get(self, image_id: str, image_in_data: Optional[dict] = None) -> None:
def mock_get(self, image_id: str, image_in_data: Optional[dict]) -> None:
"""
Mocks database methods appropriately to test the `get` repo method.
Expand Down Expand Up @@ -180,15 +180,15 @@ def test_get_with_non_existent_id(self):

image_id = str(ObjectId())

self.mock_get(image_id)
self.mock_get(image_id, None)
self.call_get_expecting_error(image_id, MissingRecordError)
self.check_get_failed_with_exception(f"No image found with ID: {image_id}", True)

def test_get_with_invalid_id(self):
"""Test getting an image with an invalid image ID."""
image_id = "invalid-id"

self.mock_get(image_id)
self.mock_get(image_id, None)
self.call_get_expecting_error(image_id, InvalidObjectIdError)
self.check_get_failed_with_exception(f"Invalid ObjectId value '{image_id}'")

Expand Down

0 comments on commit 7d5826f

Please sign in to comment.