summaryrefslogtreecommitdiffstats
path: root/contrib/python/s3transfer/py3/tests/unit/test_utils.py
diff options
context:
space:
mode:
authorrobot-piglet <[email protected]>2025-10-25 20:00:36 +0300
committerrobot-piglet <[email protected]>2025-10-25 20:13:16 +0300
commit71d288731233ecd8462d241741e46f547742ff2d (patch)
tree8932157db5113b9d7104c1ce1d722a4752127291 /contrib/python/s3transfer/py3/tests/unit/test_utils.py
parentc5c45eb3e8bbc353b8891af84dcf6f28c3bacaf3 (diff)
Intermediate changes
commit_hash:1f4ace0f7eebc924221b73c2939b9824cad6b5c5
Diffstat (limited to 'contrib/python/s3transfer/py3/tests/unit/test_utils.py')
-rw-r--r--contrib/python/s3transfer/py3/tests/unit/test_utils.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/contrib/python/s3transfer/py3/tests/unit/test_utils.py b/contrib/python/s3transfer/py3/tests/unit/test_utils.py
index 217779943b0..5cfc639ff55 100644
--- a/contrib/python/s3transfer/py3/tests/unit/test_utils.py
+++ b/contrib/python/s3transfer/py3/tests/unit/test_utils.py
@@ -20,6 +20,8 @@ import threading
import time
from io import BytesIO, StringIO
+import pytest
+
from s3transfer.futures import TransferFuture, TransferMeta
from s3transfer.utils import (
MAX_PARTS,
@@ -36,6 +38,7 @@ from s3transfer.utils import (
SlidingWindowSemaphore,
StreamReaderProgress,
TaskSemaphore,
+ add_s3express_defaults,
calculate_num_parts,
calculate_range_parameter,
get_callbacks,
@@ -1187,3 +1190,34 @@ class TestAdjustChunksize(unittest.TestCase):
chunksize = MAX_SINGLE_UPLOAD_SIZE + 1
new_size = self.adjuster.adjust_chunksize(chunksize)
self.assertEqual(new_size, MAX_SINGLE_UPLOAD_SIZE)
+
+
+class TestS3ExpressDefaults:
+ @pytest.mark.parametrize(
+ "bucket,extra_args,expected",
+ (
+ (
+ "mytestbucket--usw2-az2--x-s3",
+ {},
+ {"ChecksumAlgorithm": "crc32"},
+ ),
+ (
+ "mytestbucket--usw2-az2--x-s3",
+ {"Some": "Setting"},
+ {"ChecksumAlgorithm": "crc32", "Some": "Setting"},
+ ),
+ (
+ "mytestbucket",
+ {},
+ {},
+ ),
+ (
+ "mytestbucket--usw2-az2--x-s3",
+ {"ChecksumAlgorithm": "sha256"},
+ {"ChecksumAlgorithm": "sha256"},
+ ),
+ ),
+ )
+ def test_add_s3express_defaults(self, bucket, extra_args, expected):
+ add_s3express_defaults(bucket, extra_args)
+ assert extra_args == expected