code: def test_with_query_params(self):
      replacer = URLReplacer(
          ports={4000: 5000, 3001: 5501},
          app_specs=[
              AppSpec(
                  port=3001,
                  app_name="qwerty",
                  url_query_params={"q": "foobar"},
              )
          ],
          hostname=localhost,
          secure=False,
      )
      assert (
          replacer(b"http://0.0.0.0:3001/qwerty")
          == b"http://127.0.0.1:5501/qwerty?q=foobar"
      )
  
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 4 for calling the TestTaskURLReplacer obj's underlying member method code with example usage: obj.test_with_query_params() without return types