diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-05-14 15:21:26 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-05-14 15:21:26 (GMT) |
commit | da0dc2e468552560af6d8d8988e05c9b75a93b61 (patch) | |
tree | 85b530d990127588a48550cc5d8cec89efec9158 /Lib/distutils/tests | |
parent | 434caaab7548134e19f51f892908fbce415976ee (diff) | |
download | cpython-da0dc2e468552560af6d8d8988e05c9b75a93b61.zip cpython-da0dc2e468552560af6d8d8988e05c9b75a93b61.tar.gz cpython-da0dc2e468552560af6d8d8988e05c9b75a93b61.tar.bz2 |
Merged revisions 72624 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r72624 | tarek.ziade | 2009-05-14 16:56:14 +0200 (Thu, 14 May 2009) | 1 line
pep8-fied distutils.command.sdist + more tests
........
Diffstat (limited to 'Lib/distutils/tests')
-rw-r--r-- | Lib/distutils/tests/test_sdist.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py index ec95ffb..9e27933 100644 --- a/Lib/distutils/tests/test_sdist.py +++ b/Lib/distutils/tests/test_sdist.py @@ -13,7 +13,7 @@ from distutils.command.sdist import sdist from distutils.command.sdist import show_formats from distutils.core import Distribution from distutils.tests.test_config import PyPIRCCommandTestCase -from distutils.errors import DistutilsExecError +from distutils.errors import DistutilsExecError, DistutilsOptionError from distutils.spawn import find_executable from distutils.tests import support from distutils.archive_util import ARCHIVE_FORMATS @@ -224,6 +224,28 @@ class sdistTestCase(PyPIRCCommandTestCase): if line.strip().startswith('--formats=')] self.assertEquals(len(output), num_formats) + def test_finalize_options(self): + + dist, cmd = self.get_cmd() + cmd.finalize_options() + + # default options set by finalize + self.assertEquals(cmd.manifest, 'MANIFEST') + self.assertEquals(cmd.template, 'MANIFEST.in') + self.assertEquals(cmd.dist_dir, 'dist') + + # formats has to be a string splitable on (' ', ',') or + # a stringlist + cmd.formats = 1 + self.assertRaises(DistutilsOptionError, cmd.finalize_options) + cmd.formats = ['zip'] + cmd.finalize_options() + + # formats has to be known + cmd.formats = 'supazipa' + self.assertRaises(DistutilsOptionError, cmd.finalize_options) + + def test_suite(): return unittest.makeSuite(sdistTestCase) |