[Python-checkins] distutils2: Removed unit tests for bdist_rpm.

alexandre.vassalotti python-checkins at python.org
Tue Mar 16 01:47:27 CET 2010


alexandre.vassalotti pushed 932d3aefeae4 to distutils2:

http://hg.python.org/distutils2/rev/932d3aefeae4
changeset:   75:932d3aefeae4
tag:         tip
user:        Alexandre Vassalotti <alexandre at peadrop.com>
date:        Mon Mar 15 20:47:16 2010 -0400
summary:     Removed unit tests for bdist_rpm.
files:       src/distutils2/tests/test_bdist_rpm.py

diff --git a/src/distutils2/tests/test_bdist_rpm.py b/src/distutils2/tests/test_bdist_rpm.py
deleted file mode 100644
--- a/src/distutils2/tests/test_bdist_rpm.py
+++ /dev/null
@@ -1,127 +0,0 @@
-"""Tests for distutils.command.bdist_rpm."""
-
-import unittest2
-import sys
-import os
-import tempfile
-import shutil
-
-from distutils2.tests import run_unittest
-
-from distutils2.core import Distribution
-from distutils2.command.bdist_rpm import bdist_rpm
-from distutils2.tests import support
-from distutils2.spawn import find_executable
-from distutils2 import spawn
-from distutils2.errors import DistutilsExecError
-
-SETUP_PY = """\
-from distutils.core import setup
-import foo
-
-setup(name='foo', version='0.1', py_modules=['foo'],
-      url='xxx', author='xxx', author_email='xxx')
-
-"""
-
-class BuildRpmTestCase(support.TempdirManager,
-                       support.LoggingSilencer,
-                       unittest2.TestCase):
-
-    def setUp(self):
-        super(BuildRpmTestCase, self).setUp()
-        self.old_location = os.getcwd()
-        self.old_sys_argv = sys.argv, sys.argv[:]
-
-    def tearDown(self):
-        os.chdir(self.old_location)
-        sys.argv = self.old_sys_argv[0]
-        sys.argv[:] = self.old_sys_argv[1]
-        super(BuildRpmTestCase, self).tearDown()
-
-    def test_quiet(self):
-
-        # XXX I am unable yet to make this test work without
-        # spurious sdtout/stderr output under Mac OS X
-        if sys.platform != 'linux2':
-            return
-
-        # this test will run only if the rpm commands are found
-        if (find_executable('rpm') is None or
-            find_executable('rpmbuild') is None):
-            return
-
-        # let's create a package
-        tmp_dir = self.mkdtemp()
-        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
-
-        # running in quiet mode
-        cmd.quiet = 1
-        cmd.ensure_finalized()
-        cmd.run()
-
-        dist_created = os.listdir(os.path.join(pkg_dir, 'dist'))
-        self.assertTrue('foo-0.1-1.noarch.rpm' in dist_created)
-
-    def test_no_optimize_flag(self):
-
-        # XXX I am unable yet to make this test work without
-        # spurious sdtout/stderr output under Mac OS X
-        if sys.platform != 'linux2':
-            return
-
-        # http://bugs.python.org/issue1533164
-        # this test will run only if the rpm command is found
-        if (find_executable('rpm') is None or
-            find_executable('rpmbuild') is None):
-            return
-
-        # let's create a package that brakes bdist_rpm
-        tmp_dir = self.mkdtemp()
-        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.assertTrue('foo-0.1-1.noarch.rpm' in dist_created)
-        os.remove(os.path.join(pkg_dir, 'dist', 'foo-0.1-1.noarch.rpm'))
-
-def test_suite():
-    return unittest2.makeSuite(BuildRpmTestCase)
-
-if __name__ == '__main__':
-    run_unittest(test_suite())

--
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list