code: def test_get_outputs(self):
      tmp_dir = self.mkdtemp()
      c_file = os.path.join(tmp_dir, "foo.c")
      self.write_file(c_file, "void initfoo(void) {};\n")
      ext = Extension("foo", [c_file])
      dist = Distribution({"name": "xx", "ext_modules": [ext]})
      cmd = build_ext(dist)
      support.fixup_build_ext(cmd)
      cmd.ensure_finalized()
      self.assertEqual(len(cmd.get_outputs()), 1)
  
      cmd.build_lib = os.path.join(self.tmp_dir, "build")
      cmd.build_temp = os.path.join(self.tmp_dir, "tempt")
  
      # issue #5977 : distutils build_ext.get_outputs
      # returns wrong result with --inplace
      other_tmp_dir = os.path.realpath(self.mkdtemp())
      old_wd = os.getcwd()
      os.chdir(other_tmp_dir)
      try:
          cmd.inplace = 1
          cmd.run()
          so_file = cmd.get_outputs()[0]
      finally:
          os.chdir(old_wd)
      self.assertTrue(os.path.exists(so_file))
      self.assertEqual(
          os.path.splitext(so_file)[-1], sysconfig.get_config_var("SO")
      )
      so_dir = os.path.dirname(so_file)
      self.assertEqual(so_dir, other_tmp_dir)
      cmd.compiler = None
      cmd.inplace = 0
      cmd.run()
      so_file = cmd.get_outputs()[0]
      self.assertTrue(os.path.exists(so_file))
      self.assertEqual(
          os.path.splitext(so_file)[-1], sysconfig.get_config_var("SO")
      )
      so_dir = os.path.dirname(so_file)
      self.assertEqual(so_dir, cmd.build_lib)
  
      # inplace = 0, cmd.package = 'bar'
      build_py = cmd.get_finalized_command("build_py")
      build_py.package_dir = {"": "bar"}
      path = cmd.get_ext_fullpath("foo")
      # checking that the last directory is the build_dir
      path = os.path.split(path)[0]
      self.assertEqual(path, cmd.build_lib)
  
      # inplace = 1, cmd.package = 'bar'
      cmd.inplace = 1
      other_tmp_dir = os.path.realpath(self.mkdtemp())
      old_wd = os.getcwd()
      os.chdir(other_tmp_dir)
      try:
          path = cmd.get_ext_fullpath("foo")
      finally:
          os.chdir(old_wd)
      # checking that the last directory is bar
      path = os.path.split(path)[0]
      lastdir = os.path.split(path)[-1]
      self.assertEqual(lastdir, "bar")
  
imports: import sys
  import os
  from StringIO import StringIO
  import textwrap
  from distutils.core import Extension, Distribution
  from distutils.command.build_ext import build_ext
  from distutils import sysconfig
  from distutils.tests import support
  from distutils.errors import DistutilsSetupError, CompileError, DistutilsPlatformError
  import unittest
  from test import test_support
label_desc: Use image node_id 10 for calling the BuildExtTestCase obj's underlying member method code with example usage: obj.test_get_outputs() without return types