code: def setUp(self):
      super().setUp()
      # Change the encoding for Click since Python 3 is configured to use ASCII as
      # encoding for the environment.
      if codecs.lookup(locale.getpreferredencoding()).name == "ascii":
          os.environ["LANG"] = "en_US.utf-8"
          logging.info(
              "Changing locale to %s to ensure UTF-8 environment.",
              os.environ["LANG"],
          )
      self.runner = click_testing.CliRunner()
      self.addCleanup(mock.patch.stopall)
      mock.patch.object(template_handler, "list_template").start()
      mock.patch.object(template_handler, "copy_template").start()
  
file_path: tfx/tfx/tools/cli/commands/template_test.py
imports: import codecs
  import locale
  import os
  from unittest import mock
  from absl import logging
  from click import testing
  import tensorflow
  from tfx.tools.cli.commands.template import template_group
  from tfx.tools.cli.handler import template_handler
label_desc: Use image node_id 1 for calling the TemplateTest obj's underlying member method code with example usage: obj.setUp() without return types