Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sagemaker-core/tests/unit/helper/test_session_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ def test_expand_role_with_role_name(self, mock_boto_session, mock_sagemaker_clie
assert result == "arn:aws:iam::123456789012:role/MyRole"


class TestGenerateDefaultSagemakerBucketName:
class TestGenerateDefaultSagemakerBucketNameRegions:
"""Test generate_default_sagemaker_bucket_name static method."""

def test_generate_default_sagemaker_bucket_name_standard_region(
Expand Down
16 changes: 8 additions & 8 deletions sagemaker-core/tests/unit/local/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,9 @@ def test_hosting_container_run(self, mock_popen):
mock_popen.assert_called_once()

@patch("sagemaker.core.local.utils.kill_child_processes")
@patch("platform.system")
def test_hosting_container_down_unix(self, mock_platform, mock_kill):
@patch("sagemaker.core.local.image.os.name", "posix")
def test_hosting_container_down_unix(self, mock_kill):
"""Test _HostingContainer down method on Unix"""
mock_platform.return_value = "Linux"
mock_process = Mock()
mock_process.pid = 12345

Expand All @@ -519,16 +518,17 @@ def test_hosting_container_down_unix(self, mock_platform, mock_kill):
mock_kill.assert_called_once_with(12345)
mock_process.terminate.assert_called_once()

@patch("platform.system")
def test_hosting_container_down_windows(self, mock_platform):
@patch("sagemaker.core.local.utils.kill_child_processes")
@patch("sagemaker.core.local.image.os.name", "nt")
def test_hosting_container_down_windows(self, mock_kill):
"""Test _HostingContainer down method on Windows"""
mock_platform.return_value = "Windows"
mock_process = Mock()

container = _HostingContainer(["docker", "compose", "up"])
container.process = mock_process
container.down()

mock_kill.assert_not_called()
mock_process.terminate.assert_called_once()


Expand Down Expand Up @@ -1134,7 +1134,7 @@ def test_create_processing_config_file_directories(self):
assert mock_makedirs.call_count >= 1


class TestVolume:
class TestVolumeInit:
"""Test cases for _Volume class"""

def test_init_with_host_and_container_dir(self):
Expand All @@ -1161,7 +1161,7 @@ def test_map_property(self):
assert "/container/path" in result


class TestHostingContainer:
class TestHostingContainerLifecycle:
"""Test cases for _HostingContainer class"""

def test_init(self):
Expand Down
2 changes: 1 addition & 1 deletion sagemaker-core/tests/unit/test_jumpstart_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1893,7 +1893,7 @@ def test_get_draft_model_content_bucket_other_provider(self, mock_neo):
assert result == "neo-bucket"


class TestRemoveEnvVarFromEstimatorKwargsIfAcceptEulaPresent:
class TestRemoveEnvVarFromEstimatorKwargsIfAcceptEulaPresentValues:
"""Test cases for remove_env_var_from_estimator_kwargs_if_accept_eula_present function"""

def test_remove_env_var_accept_eula_true(self):
Expand Down
2 changes: 1 addition & 1 deletion sagemaker-serve/tests/unit/test_model_builder_servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ def test_model_as_empty_string_is_falsy(self):
self.assertIn("Missing required parameter", str(context.exception))


class TestModelBuilderServersConstants(unittest.TestCase):
class TestModelBuilderServersConstantsTypes(unittest.TestCase):
"""Test that constants are properly defined."""

def test_all_constants_are_strings(self):
Expand Down
Loading