code: def test_sendfile_fallback_close_peer_in_the_middle_of_receiving(
      self,
  ):
      def sendfile_native(transp, file, offset, count):
          # to raise SendfileNotAvailableError
          return base_events.BaseEventLoop._sendfile_native(
              self.loop, transp, file, offset, count
          )
  
      self.loop._sendfile_native = sendfile_native
  
      srv_proto, cli_proto = self.prepare_sendfile(close_after=1024)
      with self.assertRaises(ConnectionError):
          try:
              self.run_loop(
                  self.loop.sendfile(cli_proto.transport, self.file)
              )
          except OSError as e:
              # macOS may raise OSError of EPROTOTYPE when writing to a
              # socket that is in the process of closing down.
              if (
                  e.errno == errno.EPROTOTYPE
                  and sys.platform == "darwin"
              ):
                  raise ConnectionError
              else:
                  raise
  
      self.run_loop(srv_proto.done)
  
      self.assertTrue(
          1024 <= srv_proto.nbytes < len(self.DATA), srv_proto.nbytes
      )
      self.assertTrue(
          1024 <= self.file.tell() < len(self.DATA), self.file.tell()
      )
  
imports: import asyncio
  import errno
  import os
  import socket
  import sys
  import tempfile
  import unittest
  from asyncio import base_events
  from asyncio import constants
  from unittest import mock
  from test import support
  from test.support import os_helper
  from test.support import socket_helper
  from test.test_asyncio import utils
label_desc: Use image node_id 15 for calling the SendfileMixin obj's underlying member method code with example usage: obj.test_sendfile_fallback_close_peer_in_the_middle_of_receiving() and returns: base_events