code: def test_hostname(self):
      replacer = URLReplacer(
          ports={3001: 3001},
          app_specs=[AppSpec(port=3001, app_name="qwerty")],
          hostname="host.name",
          secure=False,
      )
      assert (
          replacer(b"http://0.0.0.0:3001/qwerty")
          == b"http://host.name:3001/qwerty"
      )
  
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 2 for calling the TestTaskURLReplacer obj's underlying member method code with example usage: obj.test_hostname() without return types