Skip to content

Commit 4cef235

Browse files
committed
MultiPartCopy with Sync Algorithm (aws#4475)
* first pass at sync function with util classes * adding tests and update clases * linting * file generator class inheritance * lint * multipart copy and algorithm updates * modularize sync * reformatting folders * testing for sync * do not tolerate vulnerable * remove prints * handle multithreading progress bar * update tests * optimize function and add hub bucket prefix * docstrings and linting
1 parent 82d0d92 commit 4cef235

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

tests/unit/sagemaker/jumpstart/curated_hub/test_utils.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,7 @@ def test_generate_hub_arn_for_init_kwargs():
139139
utils.generate_hub_arn_for_init_kwargs(hub_arn, "us-east-1", mock_custom_session) == hub_arn
140140
)
141141

142-
assert (
143-
utils.generate_hub_arn_for_estimator_init_kwargs(hub_arn, None, mock_custom_session)
144-
== hub_arn
145-
)
142+
assert utils.generate_hub_arn_for_init_kwargs(hub_arn, None, mock_custom_session) == hub_arn
146143

147144

148145
def test_generate_default_hub_bucket_name():
@@ -162,8 +159,14 @@ def test_create_hub_bucket_if_it_does_not_exist():
162159
mock_sagemaker_session.client("sts").get_caller_identity.return_value = {
163160
"Account": "123456789123"
164161
}
162+
hub_arn = "arn:aws:sagemaker:us-west-2:12346789123:hub/my-awesome-hub"
163+
# Mock custom session with custom values
164+
mock_custom_session = Mock()
165+
mock_custom_session.account_id.return_value = "000000000000"
166+
mock_custom_session.boto_region_name = "us-east-2"
165167
mock_sagemaker_session.boto_session.resource("s3").Bucket().creation_date = None
166168
mock_sagemaker_session.boto_region_name = "us-east-1"
169+
167170
bucket_name = "sagemaker-hubs-us-east-1-123456789123"
168171
created_hub_bucket_name = utils.create_hub_bucket_if_it_does_not_exist(
169172
sagemaker_session=mock_sagemaker_session

tests/unit/sagemaker/jumpstart/test_cache.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ def test_jumpstart_local_metadata_override_specs_not_exist_both_directories(
11341134

11351135
mocked_is_dir.assert_any_call("/some/directory/metadata/manifest/root")
11361136
assert mocked_is_dir.call_count == 2
1137-
assert mocked_open.call_count == 2
1137+
mocked_open.assert_not_called()
11381138
mocked_get_json_file_and_etag_from_s3.assert_has_calls(
11391139
calls=[
11401140
call("models_manifest.json"),

0 commit comments

Comments
 (0)