code: def test_redeploy_same_app(mocked_application_state):
      """Test redeploying same application with updated deployments."""
      app_state, deployment_state_manager = mocked_application_state
      a_id = DeploymentID("a", "test_app")
      b_id = DeploymentID("b", "test_app")
      c_id = DeploymentID("c", "test_app")
      app_state.deploy(
          {"a": deployment_info("a"), "b": deployment_info("b")}
      )
      assert app_state.status == ApplicationStatus.DEPLOYING
  
      # Update
      app_state.update()
      assert app_state.status == ApplicationStatus.DEPLOYING
      assert set(app_state.target_deployments) == {"a", "b"}
  
      # Transition to running
      deployment_state_manager.set_deployment_healthy(a_id)
      app_state.update()
      assert app_state.status == ApplicationStatus.DEPLOYING
      deployment_state_manager.set_deployment_healthy(b_id)
      app_state.update()
      assert app_state.status == ApplicationStatus.RUNNING
  
      # Deploy the same app with different deployments
      app_state.deploy(
          {"b": deployment_info("b"), "c": deployment_info("c")}
      )
      assert app_state.status == ApplicationStatus.DEPLOYING
      # Target state should be updated immediately
      assert "a" not in app_state.target_deployments
  
      # Remove deployment `a`
      app_state.update()
      deployment_state_manager.set_deployment_deleted(a_id)
      app_state.update()
      assert app_state.status == ApplicationStatus.DEPLOYING
  
      # Move to running
      deployment_state_manager.set_deployment_healthy(c_id)
      app_state.update()
      assert app_state.status == ApplicationStatus.DEPLOYING
      deployment_state_manager.set_deployment_healthy(b_id)
      app_state.update()
      assert app_state.status == ApplicationStatus.RUNNING
  
imports: import sys
  from typing import Dict, List, Tuple
  from unittest.mock import Mock, PropertyMock, patch
  import pytest
  from ray.exceptions import RayTaskError
  from ray.serve._private.application_state import ApplicationState, ApplicationStateManager, override_deployment_info
  from ray.serve._private.common import ApplicationStatus, DeploymentID, DeploymentStatus, DeploymentStatusInfo, DeploymentStatusTrigger
  from ray.serve._private.config import DeploymentConfig, ReplicaConfig
  from ray.serve._private.deploy_utils import deploy_args_to_deployment_info
  from ray.serve._private.deployment_info import DeploymentInfo
  from ray.serve._private.test_utils import MockKVStore
  from ray.serve._private.utils import get_random_string
  from ray.serve.exceptions import RayServeException
  from ray.serve.schema import DeploymentSchema, ServeApplicationSchema
label_desc: Use image node_id 11 for calling a global function with example usage: test_redeploy_same_app(mocked_application_state) without return types