code: def test_patch_should_update_correct_roles_permissions(self):
      create_role(self.app, "role_to_change")
      create_role(self.app, "already_exists")
  
      response = self.client.patch(
          "/auth/fab/v1/roles/role_to_change",
          json={
              "name": "already_exists",
              "actions": [
                  {
                      "action": {"name": "can_delete"},
                      "resource": {"name": "XComs"},
                  }
              ],
          },
          environ_overrides={"REMOTE_USER": "test"},
      )
      assert response.status_code == 200
  
      updated_permissions = self.app.appbuilder.sm.find_role(
          "role_to_change"
      ).permissions
      assert len(updated_permissions) == 1
      assert updated_permissions[0].resource.name == "XComs"
      assert updated_permissions[0].action.name == "can_delete"
  
      assert (
          len(
              self.app.appbuilder.sm.find_role(
                  "already_exists"
              ).permissions
          )
          == 0
      )
  
imports: from __future__ import annotations
  import pytest
  from airflow.api_connexion.exceptions import EXCEPTIONS_LINK_MAP
  from airflow.providers.fab.auth_manager.models import Role
  from airflow.providers.fab.auth_manager.security_manager.override import EXISTING_ROLES
  from airflow.security import permissions
  from tests.test_utils.api_connexion_utils import assert_401, create_role, create_user, delete_role, delete_user
label_desc: Use image node_id 2 for calling the TestPatchRole obj's underlying member method code with example usage: obj.test_patch_should_update_correct_roles_permissions() without return types