code: def test_sendfile_close_peer_in_the_middle_of_receiving(self):
      srv_proto, cli_proto = self.prepare_sendfile(close_after=1024)
      with self.assertRaises(ConnectionError):
          self.run_loop(
              self.loop.sendfile(cli_proto.transport, self.file)
          )
      self.run_loop(srv_proto.done)
  
      self.assertTrue(
          1024 <= srv_proto.nbytes < len(self.DATA), srv_proto.nbytes
      )
      if not (
          sys.platform == "win32"
          and isinstance(self.loop, asyncio.ProactorEventLoop)
      ):
          # On Windows, Proactor uses transmitFile, which does not update tell()
          self.assertTrue(
              1024 <= self.file.tell() < len(self.DATA),
              self.file.tell(),
          )
      self.assertTrue(cli_proto.transport.is_closing())
  
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 14 for calling the SendfileMixin obj's underlying member method code with example usage: obj.test_sendfile_close_peer_in_the_middle_of_receiving() without return types