docstr: When target capacity goes null -> non-null, scale down must start.
docstr_tok: ["When","target","capacity","goes","null","-",">","non-null",",","scale","down","must","start","."]
code: def test_exit_null_target_capacity(self, new_target_capacity):
      """When target capacity goes null -> non-null, scale down must start."""
  
      curr_config = ServeDeploySchema(
          target_capacity=None,
          applications=[create_app_config(name="app1")],
      )
  
      new_config = deepcopy(curr_config)
      new_config.target_capacity = new_target_capacity
  
      # When Serve is already running the applications at target_capacity
      # None, and then a target_capacity is applied, the direction must
      # become DOWN.
      assert (
          calculate_target_capacity_direction(
              curr_config,
              new_config,
              None,
          )
          == TargetCapacityDirection.DOWN
      )
  
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 4 for calling the TestCalculateScaleDirection obj's underlying member method code with example usage: obj.test_exit_null_target_capacity(new_target_capacity) without return types