code: def test_launch_add_template_variables(runner, relay_server, user):
      queue_name = "tvqueue"
      proj = "test1"
      queue_config = {"e": ["{{var1}}"]}
      queue_template_variables = {
          "var1": {"schema": {"type": "string", "enum": ["a", "b"]}}
      }
      template_variables = {"var1": "a"}
      base_config = {"template_variables": {"var1": "b"}}
      with relay_server() as relay, runner.isolated_filesystem():
          api = PublicApi(api_key=user)
          api.create_run_queue(
              entity=user,
              name=queue_name,
              type="local-container",
              config=queue_config,
              template_variables=queue_template_variables,
          )
          _ = launch_add(
              template_variables=template_variables,
              project=proj,
              entity=user,
              queue_name=queue_name,
              docker_image="abc:latest",
              config=base_config,
          )
          for comm in relay.context.raw_data:
              q = comm["request"].get("query")
              vars = comm["request"].get("variables")
              if q and "mutation pushToRunQueueByName(" in str(q):
                  assert comm["response"].get("data") is not None
                  assert (
                      vars["templateVariableValues"] == '{"var1": "a"}'
                  )
              elif q and "mutation pushToRunQueue(" in str(q):
                  raise Exception(
                      "should not be falling back to legacy here"
                  )
  
imports: import json
  import os
  from unittest import mock
  import pytest
  import wandb
  from wandb.apis.public import Api
  from wandb.sdk.internal.internal_api import Api
  from wandb.sdk.internal.internal_api import UnsupportedError
  from wandb.sdk.launch._launch_add import launch_add
  from wandb.sdk.launch.utils import LAUNCH_DEFAULT_PROJECT, LaunchError
label_desc: Use image node_id 13 for calling a global function with example usage: test_launch_add_template_variables(runner, relay_server, user) without return types