Skip to content

Commit

Permalink
Merge pull request #34 from KelvinHong/33-fixing-get-object-no-such-key
Browse files Browse the repository at this point in the history
33 fixing get object no such key
  • Loading branch information
oussjarrousse committed May 26, 2024
2 parents b2b0904 + 85ed555 commit 84579c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pytest_minio_mock/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def get_object(self, object_name, version_id):
request_id=None,
host_id=None,
response="mocked_response",
code=404,
code="NoSuchKey",
bucket_name=self.bucket_name,
object_name=object_name,
) from exc
Expand Down
5 changes: 3 additions & 2 deletions tests/test_minio_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_remove_bucket(minio_mock):

@pytest.mark.API
@pytest.mark.FUNC
def test_putting_and_removing_objects_no_versionning(minio_mock):
def test_putting_and_removing_objects_no_versioning(minio_mock):
# simple thing
bucket_name = "test-bucket"
object_name = "test-object"
Expand All @@ -110,7 +110,8 @@ def test_putting_and_removing_objects_no_versionning(minio_mock):
# test retrieving object after it has been removed
with pytest.raises(S3Error) as error:
_ = client.get_object(bucket_name, object_name)
assert "The specified key does not exist" in str(error.value)
assert error.value.message == "The specified key does not exist."
assert error.value.code == "NoSuchKey"


@pytest.mark.API
Expand Down

0 comments on commit 84579c3

Please sign in to comment.