code: def test_no_optimize_flag(self):
      # let's create a package that breaks bdist_rpm
      tmp_dir = self.mkdtemp()
      os.environ["HOME"] = tmp_dir  # to confine dir '.rpmdb' creation
      pkg_dir = os.path.join(tmp_dir, "foo")
      os.mkdir(pkg_dir)
      self.write_file((pkg_dir, "setup.py"), SETUP_PY)
      self.write_file((pkg_dir, "foo.py"), "#")
      self.write_file((pkg_dir, "MANIFEST.in"), "include foo.py")
      self.write_file((pkg_dir, "README"), "")
  
      dist = Distribution(
          {
              "name": "foo",
              "version": "0.1",
              "py_modules": ["foo"],
              "url": "xxx",
              "author": "xxx",
              "author_email": "xxx",
          }
      )
      dist.script_name = "setup.py"
      os.chdir(pkg_dir)
  
      sys.argv = ["setup.py"]
      cmd = bdist_rpm(dist)
      cmd.fix_python = True
  
      cmd.quiet = 1
      cmd.ensure_finalized()
      cmd.run()
  
      dist_created = os.listdir(os.path.join(pkg_dir, "dist"))
      self.assertIn("foo-0.1-1.noarch.rpm", dist_created)
  
      # bug #2945: upload ignores bdist_rpm files
      self.assertIn(
          ("bdist_rpm", "any", "dist/foo-0.1-1.src.rpm"),
          dist.dist_files,
      )
      self.assertIn(
          ("bdist_rpm", "any", "dist/foo-0.1-1.noarch.rpm"),
          dist.dist_files,
      )
  
      os.remove(os.path.join(pkg_dir, "dist", "foo-0.1-1.noarch.rpm"))
  
imports: import unittest
  import sys
  import os
  import tempfile
  import shutil
  from test.test_support import run_unittest
  from distutils.core import Distribution
  from distutils.command.bdist_rpm import bdist_rpm
  from distutils.tests import support
  from distutils.spawn import find_executable
  from distutils import spawn
  from distutils.errors import DistutilsExecError
label_desc: Use image node_id 4 for calling the BuildRpmTestCase obj's underlying member method code with example usage: obj.test_no_optimize_flag() without return types