diff --git a/tests/functional/test_credentials.py b/tests/functional/test_credentials.py index a68a4a6163..03e3288e07 100644 --- a/tests/functional/test_credentials.py +++ b/tests/functional/test_credentials.py @@ -790,9 +790,7 @@ def assert_session_credentials(self, expected_params, **kwargs): expected_creds = self.create_random_credentials() response = self.create_assume_role_response(expected_creds) session = StubbedSession(**kwargs) - stubber = session.stub( - 'sts', config=Config(signature_version=UNSIGNED) - ) + stubber = session.stub('sts') stubber.add_response( 'assume_role_with_web_identity', response, expected_params ) diff --git a/tests/unit/test_session.py b/tests/unit/test_session.py index ef2495ebcf..49162675d3 100644 --- a/tests/unit/test_session.py +++ b/tests/unit/test_session.py @@ -549,6 +549,20 @@ def test_cred_provider_called_when_partial_creds_provided(self): aws_secret_access_key='foo', ) + @mock.patch('botocore.client.ClientCreator') + def test_account_id(self, client_creator): + self.session.create_client( + 'sts', + 'us-west-2', + aws_access_key_id='foo', + aws_secret_access_key='bar', + aws_session_token='baz', + aws_account_id='123456789012', + ) + call_args = client_creator.return_value.create_client.call_args[1] + credentials = call_args['credentials'] + self.assertEqual(credentials.account_id, '123456789012') + def test_cred_provider_not_called_on_unsigned_client(self): cred_provider = mock.Mock() self.session.register_component('credential_provider', cred_provider)