code: def test_max_replicas_per_node_validation(self):
      class Class:
          pass
  
      ReplicaConfig.create(
          Class,
          tuple(),
          dict(),
          max_replicas_per_node=5,
      )
  
      # Invalid type
      with pytest.raises(TypeError, match="Get invalid type"):
          ReplicaConfig.create(
              Class,
              tuple(),
              dict(),
              max_replicas_per_node="1",
          )
  
      # Invalid: not in the range of [1, 100]
      with pytest.raises(
          ValueError,
          match="Valid values are None or an integer in the range of \[1, 100\]",
      ):
          ReplicaConfig.create(
              Class,
              tuple(),
              dict(),
              max_replicas_per_node=0,
          )
  
      with pytest.raises(
          ValueError,
          match="Valid values are None or an integer in the range of \[1, 100\]",
      ):
          ReplicaConfig.create(
              Class,
              tuple(),
              dict(),
              max_replicas_per_node=110,
          )
  
      with pytest.raises(
          ValueError,
          match="Valid values are None or an integer in the range of \[1, 100\]",
      ):
          ReplicaConfig.create(
              Class,
              tuple(),
              dict(),
              max_replicas_per_node=-1,
          )
  
imports: import pytest
  from ray import cloudpickle
  from ray._private.pydantic_compat import ValidationError
  from ray._private.utils import import_attr
  from ray.serve._private.config import DeploymentConfig, ReplicaConfig, _proto_to_dict
  from ray.serve._private.constants import DEFAULT_AUTOSCALING_POLICY, DEFAULT_GRPC_PORT
  from ray.serve._private.utils import DEFAULT
  from ray.serve.autoscaling_policy import default_autoscaling_policy
  from ray.serve.config import AutoscalingConfig, DeploymentMode, HTTPOptions, ProxyLocation, gRPCOptions
  from ray.serve.generated.serve_pb2 import AutoscalingConfig
  from ray.serve.generated.serve_pb2 import DeploymentConfig
  from ray.serve.generated.serve_pb2 import DeploymentLanguage
  from ray.serve.generated.serve_pb2_grpc import add_UserDefinedServiceServicer_to_server
  from ray.serve.schema import DeploymentSchema, HTTPOptionsSchema, ServeApplicationSchema, ServeDeploySchema
label_desc: Use image node_id 3 for calling the TestReplicaConfig obj's underlying member method code with example usage: obj.test_max_replicas_per_node_validation() without return types