code: def test_empty_package_dir(self):
      # See SF 1668596/1720897.
      cwd = os.getcwd()
  
      # create the distribution files.
      sources = self.mkdtemp()
      open(os.path.join(sources, "__init__.py"), "w").close()
  
      testdir = os.path.join(sources, "doc")
      os.mkdir(testdir)
      open(os.path.join(testdir, "testfile"), "w").close()
  
      os.chdir(sources)
      old_stdout = sys.stdout
      sys.stdout = StringIO.StringIO()
  
      try:
          dist = Distribution(
              {
                  "packages": ["pkg"],
                  "package_dir": {"pkg": ""},
                  "package_data": {"pkg": ["doc/*"]},
              }
          )
          # script_name need not exist, it just need to be initialized
          dist.script_name = os.path.join(sources, "setup.py")
          dist.script_args = ["build"]
          dist.parse_command_line()
  
          try:
              dist.run_commands()
          except DistutilsFileError:
              self.fail(
                  "failed package_data test when package_dir is ''"
              )
      finally:
          # Restore state.
          os.chdir(cwd)
          sys.stdout = old_stdout
  
file_path: catboost/contrib/tools/python/src/Lib/distutils/tests/test_build_py.py
imports: import os
  import sys
  import StringIO
  import unittest
  from distutils.command.build_py import build_py
  from distutils.core import Distribution
  from distutils.errors import DistutilsFileError
  from distutils.tests import support
  from test.test_support import run_unittest
label_desc: Use image node_id 2 for calling the BuildPyTestCase obj's underlying member method code with example usage: obj.test_empty_package_dir() without return types