code: def test_handle_connection_recv_inference_before_load(
      self, patches, model_service_worker
  ):
      patches.retrieve_msg.side_effect = [(b"I", "")]
      service = Mock()
      service.context = None
      cl_socket = Mock()
  
      with pytest.raises(
          RuntimeError,
          match=r"Received command: .*, but service is not loaded",
      ):
          model_service_worker.handle_connection(cl_socket)
  
imports: import os
  import socket
  import sys
  from collections import namedtuple
  import mock
  import pytest
  from mock import Mock
  from ts.model_service_worker import TorchModelServiceWorker
  from ts.service import Service
label_desc: Use image node_id 3 for calling the TestHandleConnection obj's underlying member method code with example usage: obj.test_handle_connection_recv_inference_before_load(patches, model_service_worker) without return types