Skip to content

Commit b5426ee

Browse files
committed
Add test
1 parent 3f9b30d commit b5426ee

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/unit/sagemaker/local/test_local_utils.py

+12
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ def test_move_to_destination_s3(recursive_copy):
6666
sms.upload_data.assert_called_with("/tmp/data", "bucket", "job")
6767

6868

69+
@patch("shutil.rmtree", Mock())
70+
def test_move_to_destination_s3_with_prefix():
71+
sms = Mock(
72+
settings=SessionSettings(),
73+
)
74+
uri = sagemaker.local.utils.move_to_destination(
75+
"/tmp/data", "s3://bucket/path", "job", sms, "foo_prefix"
76+
)
77+
sms.upload_data.assert_called_with("/tmp/data", "bucket", "path/job/foo_prefix")
78+
assert uri == "s3://bucket/path/job/foo_prefix"
79+
80+
6981
def test_move_to_destination_illegal_destination():
7082
with pytest.raises(ValueError):
7183
sagemaker.local.utils.move_to_destination("/tmp/data", "ftp://ftp/in/2018", "job", None)

0 commit comments

Comments
 (0)