Skip to content

Commit a6b72ab

Browse files
committed
fix unit test
1 parent bdf984f commit a6b72ab

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/unit/test_session.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -399,14 +399,15 @@ def test_get_caller_identity_arn_from_a_role(sts_regional_endpoint, boto_session
399399
@patch("sagemaker.session.sts_regional_endpoint", return_value=STS_ENDPOINT)
400400
def test_get_caller_identity_arn_from_an_execution_role(sts_regional_endpoint, boto_session):
401401
sess = Session(boto_session)
402-
arn = "arn:aws:sts::369233609183:assumed-role/AmazonSageMaker-ExecutionRole-20171129T072388/SageMaker"
402+
sts_arn = "arn:aws:sts::369233609183:assumed-role/AmazonSageMaker-ExecutionRole-20171129T072388/SageMaker"
403403
sess.boto_session.client("sts", endpoint_url=STS_ENDPOINT).get_caller_identity.return_value = {
404-
"Arn": arn
404+
"Arn": sts_arn
405405
}
406-
sess.boto_session.client("iam").get_role.return_value = {"Role": {"Arn": arn}}
406+
iam_arn = "arn:aws:iam::369233609183:role/AmazonSageMaker-ExecutionRole-20171129T072388"
407+
sess.boto_session.client("iam").get_role.return_value = {"Role": {"Arn": iam_arn}}
407408

408409
actual = sess.get_caller_identity_arn()
409-
assert actual == "arn:aws:iam::369233609183:role/AmazonSageMaker-ExecutionRole-20171129T072388"
410+
assert actual == iam_arn
410411

411412

412413
@patch("os.path.exists", side_effect=mock_exists(NOTEBOOK_METADATA_FILE, False))

0 commit comments

Comments
 (0)