diff options
| author | Yannick Gingras <ygingras@ygingras.net> | 2010-12-08 22:28:40 -0500 |
|---|---|---|
| committer | Yannick Gingras <ygingras@ygingras.net> | 2010-12-08 22:28:40 -0500 |
| commit | ba171e144365d5edc75157cfdc249846b41fc590 (patch) | |
| tree | 2f6f9d98d9a2be6cc83f8c72cfc15bfc35e6867b | |
| parent | 31c9eb75b94c59e1cc8e0e70972eb1d379d3fa41 (diff) | |
| download | disutils2-ba171e144365d5edc75157cfdc249846b41fc590.tar.gz | |
improved test coverage for command.bdist
| -rw-r--r-- | distutils2/tests/test_command_bdist.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/distutils2/tests/test_command_bdist.py b/distutils2/tests/test_command_bdist.py index 1b447ae..c38a76b 100644 --- a/distutils2/tests/test_command_bdist.py +++ b/distutils2/tests/test_command_bdist.py @@ -2,8 +2,9 @@ from distutils2.tests import run_unittest -from distutils2.command.bdist import bdist -from distutils2.tests import unittest, support +from distutils2.command.bdist import bdist, show_formats +from distutils2.tests import unittest, support, captured_stdout + class BuildTestCase(support.TempdirManager, unittest.TestCase): @@ -28,6 +29,16 @@ class BuildTestCase(support.TempdirManager, found.sort() self.assertEqual(found, formats) + def test_show_formats(self): + __, stdout = captured_stdout(show_formats) + + # the output should be a header line + one line per format + num_formats = len(bdist.format_commands) + output = [line for line in stdout.split('\n') + if line.strip().startswith('--formats=')] + self.assertEqual(len(output), num_formats) + + def test_suite(): return unittest.makeSuite(BuildTestCase) |
