code: def test_get_tag_id_by_name(patch_vsphere_sdk_provider):
      vsp = mock_vsphere_sdk_provider()
      mock_tag = MagicMock()
      mock_tag.name = "ray-node-name"
      vsp.vsphere_sdk_client.tagging.Tag.list_tags_for_category.return_value = [
          "tag_1"
      ]
      vsp.vsphere_sdk_client.tagging.Tag.get.return_value = mock_tag
      assert (
          vsp.get_tag_id_by_name("ray-node-name", "test_category_id")
          == "tag_1"
      )
  
file_path: ray/python/ray/tests/vsphere/test_vsphere_sdk_provider.py
imports: import pytest
  from unittest.mock import MagicMock, patch
  from ray.autoscaler._private.vsphere.vsphere_sdk_provider import VsphereSdkProvider, Constants, HardPower
label_desc: Use image node_id 8 for calling a global function with example usage: test_get_tag_id_by_name(patch_vsphere_sdk_provider) without return types