[Python-checkins] distutils2: improved the test coverage on commands.bdist
eric.araujo
python-checkins at python.org
Sat Apr 21 16:30:57 CEST 2012
http://hg.python.org/distutils2/rev/9d5ae0096406
changeset: 1313:9d5ae0096406
parent: 887:cb2aa326f4c3
user: Yannick Gingras <ygingras at ygingras.net>
date: Thu Dec 09 16:57:53 2010 -0500
summary:
improved the test coverage on commands.bdist
files:
distutils2/tests/test_command_bdist.py | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/distutils2/tests/test_command_bdist.py b/distutils2/tests/test_command_bdist.py
--- 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 @@
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)
--
Repository URL: http://hg.python.org/distutils2
More information about the Python-checkins
mailing list