code: def test_prepare_credentials_for_rasa_x_if_rasa_channel_not_given(
      tmpdir: Path,
  ):
      credentials_path = str(tmpdir / "credentials.yml")
  
      rasa.shared.utils.io.write_yaml({}, credentials_path)
  
      tmp_credentials = x._prepare_credentials_for_rasa_x(
          credentials_path, "http://localhost:5002"
      )
  
      actual = rasa.shared.utils.io.read_config_file(tmp_credentials)
  
      assert actual["rasa"]["url"] == "http://localhost:5002"
  
imports: from pathlib import Path
  import sys
  import argparse
  import pytest
  from typing import Callable
  from _pytest.monkeypatch import MonkeyPatch
  from _pytest.pytester import RunResult
  from aioresponses import aioresponses
  import rasa.shared.utils.io
  from rasa.cli import x
  from rasa.utils.endpoints import EndpointConfig
  from rasa.core.utils import AvailableEndpoints
  import rasa.version
  from tests.cli.conftest import RASA_EXE
label_desc: Use image node_id 2 for calling a global function with example usage: test_prepare_credentials_for_rasa_x_if_rasa_channel_not_given(tmpdir) without return types