code: def test_change_target_capacity_numeric(
      self, curr_direction, new_direction
  ):
      curr_target_capacity = 5
  
      curr_config = ServeDeploySchema(
          target_capacity=curr_target_capacity,
          applications=[
              create_app_config(name="app1"),
              create_app_config(name="app2"),
          ],
      )
  
      if new_direction == TargetCapacityDirection.UP:
          new_target_capacity = curr_target_capacity * 3.3
      elif new_direction == TargetCapacityDirection.DOWN:
          new_target_capacity = curr_target_capacity / 3.3
  
      new_config = deepcopy(curr_config)
      new_config.target_capacity = new_target_capacity
  
      # The new direction must be returned, regardless of the current direction.
      assert (
          calculate_target_capacity_direction(
              curr_config,
              new_config,
              curr_direction,
          )
          == new_direction
      )
  
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 1 for calling the TestCalculateScaleDirection obj's underlying member method code with example usage: obj.test_change_target_capacity_numeric(curr_direction, new_direction) without return types