code: def test_fastapi(self):
      replacer = URLReplacer(
          ports={3615: 53615},
          app_specs=[AppSpec(port=3615, app_name="fastapi")],
          hostname=localhost,
          secure=False,
      )
      assert (
          replacer(
              b"\x1b[32mINFO\x1b[0m:     Uvicorn running on \x1b[1mhttp://0.0.0.0:3615\x1b[0m (Press CTRL+C to quit)"
          )
          == b"\x1b[32mINFO\x1b[0m:     Uvicorn running on \x1b[1mhttp://127.0.0.1:53615\x1b[0m (Press CTRL+C to quit)"
      )
  
file_path: dstack/src/tests/_internal/core/services/test_logs.py
imports: from dstack._internal.core.models.runs import AppSpec
  from dstack._internal.core.services.logs import URLReplacer
label_desc: Use image node_id 8 for calling the TestTaskURLReplacer obj's underlying member method code with example usage: obj.test_fastapi() without return types