https://docs.min.io/docs/python-client-api-reference.html
I have some implementation like below
class Minio:
def initialize(self):
# Create client with access key and secret key with specific region.
self.client = Minio(
"play.minio.io:9000",
access_key="access-key",
secret_key="secret-key",
region="my-region",
)
def upload_to_minio(self):
## code to upload file into minio
result = self.client.fput_object(
"my-bucket", "my-object", "my-filename",
)
print(
"created {0} object; etag: {1}, version-id: {2}".format(
result.object_name, result.etag, result.version_id,
),
)
def download_from_minio(self):
## code to download file from minio
self.client.fget_object(
"my-bucket", "my-object", "my-filename",
version_id="dfbd25b3-abec-4184-a4e8-5a35a5c1174d",
)
I want to write unit test using pytest for the above class.
Is there any package available to mock minio buckets and behaviours?
Or should we write a class for mock connection and validate the upload and download.
Can someone help on this ?