code: def test_command_packages_configfile(self):
      sys.argv.append("build")
      self.addCleanup(os.unlink, TESTFN)
      f = open(TESTFN, "w")
      try:
          print >> f, "[global]"
          print >> f, "command_packages = foo.bar, splat"
      finally:
          f.close()
  
      d = self.create_distribution([TESTFN])
      self.assertEqual(
          d.get_command_packages(),
          ["distutils.command", "foo.bar", "splat"],
      )
  
      # ensure command line overrides config:
      sys.argv[1:] = ["--command-packages", "spork", "build"]
      d = self.create_distribution([TESTFN])
      self.assertEqual(
          d.get_command_packages(), ["distutils.command", "spork"]
      )
  
      # Setting --command-packages to '' should cause the default to
      # be used even if a config file specified something else:
      sys.argv[1:] = ["--command-packages", "", "build"]
      d = self.create_distribution([TESTFN])
      self.assertEqual(d.get_command_packages(), ["distutils.command"])
  
imports: import os
  import StringIO
  import sys
  import unittest
  import warnings
  import textwrap
  from distutils.dist import Distribution, fix_help_options
  from distutils.cmd import Command
  import distutils.dist
  from test.test_support import TESTFN, captured_stdout, run_unittest, unlink
  from distutils.tests import support
  from distutils import log
label_desc: Use image node_id 7 for calling the DistributionTestCase obj's underlying member method code with example usage: obj.test_command_packages_configfile() without return types