code: def test_formats(self):
      # let's create a command and make sure
      # we can set the format
      dist = self.create_dist()[1]
      cmd = bdist(dist)
      cmd.formats = ["msi"]
      cmd.ensure_finalized()
      self.assertEqual(cmd.formats, ["msi"])
  
      # what formats does bdist offer?
      formats = [
          "bztar",
          "gztar",
          "msi",
          "rpm",
          "tar",
          "wininst",
          "zip",
          "ztar",
      ]
      found = sorted(cmd.format_command)
      self.assertEqual(found, formats)
  
file_path: catboost/contrib/tools/python/src/Lib/distutils/tests/test_bdist.py
imports: import os
  import unittest
  from test.test_support import run_unittest
  from distutils.command.bdist import bdist
  from distutils.tests import support
label_desc: Use image node_id 1 for calling the BuildTestCase obj's underlying member method code with example usage: obj.test_formats() without return types