docstr: When target capacity becomes null, scale up/down behavior must stop.
docstr_tok: ["When","target","capacity","becomes","null",",","scale","up\/down","behavior","must","stop","."]
code: def test_enter_null_target_capacity(
      self, curr_target_capacity, curr_direction
  ):
      """When target capacity becomes null, scale up/down behavior must stop."""
  
      if curr_target_capacity is None:
          # When target_capacity is None, the current direction must be None.
          curr_direction = None
  
      curr_config = ServeDeploySchema(
          target_capacity=curr_target_capacity,
          applications=[
              create_app_config(name="app1"),
              create_app_config(name="app2"),
              create_app_config(name="app3"),
          ],
      )
  
      new_config = deepcopy(curr_config)
      new_config.target_capacity = None
  
      assert (
          calculate_target_capacity_direction(
              curr_config,
              new_config,
              curr_direction,
          )
          is None
      )
  
file_path: ray/python/ray/serve/tests/unit/test_controller.py
imports: from copy import deepcopy
  import pytest
  from ray.serve._private.common import TargetCapacityDirection
  from ray.serve._private.controller import applications_match, calculate_target_capacity_direction
  from ray.serve.schema import HTTPOptionsSchema, ServeApplicationSchema, ServeDeploySchema
label_desc: Use image node_id 3 for calling the TestCalculateScaleDirection obj's underlying member method code with example usage: obj.test_enter_null_target_capacity(curr_target_capacity, curr_direction) without return types