docstr: Check how Serve handles the first config that's applied.
docstr_tok: ["Check","how","Serve","handles","the","first","config","that","'s","applied","."]
code: def test_scale_up_first_config(self):
      """Check how Serve handles the first config that's applied."""
  
      # Case 1: target_capacity is set. Serve should transition to scaling up.
  
      new_config = ServeDeploySchema(
          target_capacity=20,
          applications=[create_app_config(name="app1")],
      )
      assert (
          calculate_target_capacity_direction(
              None,
              new_config,
              None,
          )
          == TargetCapacityDirection.UP
      )
  
      # Case 2: target_capacity is not set. Serve should not be scaling.
  
      new_config = ServeDeploySchema(
          target_capacity=None,
          applications=[create_app_config(name="app1")],
      )
      assert (
          calculate_target_capacity_direction(
              None,
              new_config,
              None,
          )
          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 5 for calling the TestCalculateScaleDirection obj's underlying member method code with example usage: obj.test_scale_up_first_config() without return types