Added new tests and fixed small bugs

This commit is contained in:
Mawoka
2023-06-18 11:43:27 +02:00
parent f99453bcda
commit 8034dd2fdf
7 changed files with 194 additions and 29 deletions
+3 -2
View File
@@ -134,8 +134,9 @@ class S3Storage:
)
def size(self, file_name: str) -> int | None:
res = self.client.stat_object(bucket_name=self.bucket_name, object_name=file_name)
if res is None:
try:
res = self.client.stat_object(bucket_name=self.bucket_name, object_name=file_name)
except minio.error.S3Error:
return None
return res.size