code: def test_foreign_session_factory_s3():
      boto3 = pytest.importorskip("boto3")
      aws_session = boto3.Session(
          aws_access_key_id="foo", aws_secret_access_key="bar"
      )
      sesh = Session.from_foreign_session(aws_session, cls=AWSSession)
      assert isinstance(sesh, AWSSession)
      assert sesh._session.get_credentials().access_key == "foo"
      assert sesh._session.get_credentials().secret_key == "bar"
  
imports: from unittest import mock
  import pytest
  from fiona.session import DummySession, AWSSession, Session, OSSSession, GSSession, SwiftSession, AzureSession
label_desc: Use image node_id 18 for calling a global function with example usage: test_foreign_session_factory_s3() without return types