diff options
Diffstat (limited to 'Lib/distutils/tests/test_sdist.py')
-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) |