summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYannick Gingras <ygingras@ygingras.net>2010-12-09 16:57:53 -0500
committerYannick Gingras <ygingras@ygingras.net>2010-12-09 16:57:53 -0500
commitceaa3f0daa4e64c403a0e705ff9a30e0854c54aa (patch)
tree3be05203303a65a1da5f5194d81327dab1521469
parentd8fdcf0f4e5c6e10952a56d8be576aeafa7c2b8a (diff)
downloaddisutils2-ceaa3f0daa4e64c403a0e705ff9a30e0854c54aa.tar.gz
improved the test coverage on commands.bdist
-rw-r--r--distutils2/tests/test_command_bdist.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/distutils2/tests/test_command_bdist.py b/distutils2/tests/test_command_bdist.py
index ad05910..b3f67be 100644
--- a/distutils2/tests/test_command_bdist.py
+++ b/distutils2/tests/test_command_bdist.py
@@ -1,12 +1,13 @@
"""Tests for distutils.command.bdist."""
+import os
from distutils2 import util
from distutils2.tests import run_unittest
from distutils2.command.bdist import bdist, show_formats
+from distutils2.errors import DistutilsPlatformError
from distutils2.tests import unittest, support, captured_stdout
-
class BuildTestCase(support.TempdirManager,
unittest.TestCase):
@@ -61,6 +62,17 @@ class BuildTestCase(support.TempdirManager,
cmd.ensure_finalized()
self.assertTrue(self._get_platform_called)
+ def test_unsupported_platform(self):
+ try:
+ _os_name = os.name
+ os.name = "some-obscure-os"
+
+ pkg_pth, dist = self.create_dist()
+ cmd = bdist(dist)
+ self.assertRaises(DistutilsPlatformError, cmd.ensure_finalized)
+ finally:
+ os.name = _os_name
+
def test_show_formats(self):
__, stdout = captured_stdout(show_formats)