Skip to content

Commit 2f5f29b

Browse files
author
Malav Shastri
committed
Address merge conflicts
1 parent ccb640c commit 2f5f29b

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

tests/unit/sagemaker/jumpstart/test_utils.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from __future__ import absolute_import
1414
import os
1515
from unittest import TestCase
16+
from unittest.mock import call
1617

1718
from botocore.exceptions import ClientError
1819
from mock.mock import Mock, patch
@@ -1932,7 +1933,40 @@ def test_get_default_jumpstart_session_with_user_agent_suffix(
19321933
botocore_session=mock_boto3_session.get_session.return_value,
19331934
)
19341935
mock_boto3_client.assert_has_calls(
1935-
=======
1936+
[
1937+
call(
1938+
"sagemaker",
1939+
region_name=JUMPSTART_DEFAULT_REGION_NAME,
1940+
config=mock_botocore_config.return_value,
1941+
),
1942+
call(
1943+
"sagemaker-runtime",
1944+
region_name=JUMPSTART_DEFAULT_REGION_NAME,
1945+
config=mock_botocore_config.return_value,
1946+
),
1947+
],
1948+
any_order=True,
1949+
)
1950+
1951+
@patch("botocore.client.BaseClient._make_request")
1952+
def test_get_default_jumpstart_session_with_user_agent_suffix_http_header(
1953+
self,
1954+
mock_make_request,
1955+
):
1956+
session = utils.get_default_jumpstart_session_with_user_agent_suffix(
1957+
"model_id", "model_version"
1958+
)
1959+
try:
1960+
session.sagemaker_client.list_endpoints()
1961+
except Exception:
1962+
pass
1963+
1964+
assert (
1965+
"md/js_model_id#model_id md/js_model_ver#model_version"
1966+
in mock_make_request.call_args[0][1]["headers"]["User-Agent"]
1967+
)
1968+
1969+
19361970
def test_extract_metrics_from_deployment_configs():
19371971
configs = get_base_deployment_configs_metadata()
19381972
configs[0].benchmark_metrics = None

0 commit comments

Comments
 (0)