[Python-checkins] distutils2 (merge default -> default): Merge Yannick’s test into main repo

eric.araujo python-checkins at python.org
Sat Apr 21 16:30:57 CEST 2012


http://hg.python.org/distutils2/rev/6e5312167b4a
changeset:   1314:6e5312167b4a
parent:      1312:e0d1ba9899d5
parent:      1313:9d5ae0096406
user:        Éric Araujo <merwok at netwok.org>
date:        Sat Apr 21 10:30:23 2012 -0400
summary:
  Merge Yannick’s test into main repo

files:
  distutils2/tests/test_command_bdist.py |  13 +++++++++++++
  1 files changed, 13 insertions(+), 0 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
@@ -2,7 +2,9 @@
 import os
 import sys
 from StringIO import StringIO
+from distutils2.errors import PackagingPlatformError
 from distutils2.command.bdist import bdist, show_formats
+
 from distutils2.tests import unittest, support
 
 
@@ -43,6 +45,17 @@
             self.assertTrue(subcmd.skip_build,
                             '%s should take --skip-build from bdist' % name)
 
+    def test_unsupported_platform(self):
+        _os_name = os.name
+        try:
+            os.name = 'some-obscure-os'
+
+            dist = self.create_dist()[1]
+            cmd = bdist(dist)
+            self.assertRaises(PackagingPlatformError, cmd.ensure_finalized)
+        finally:
+            os.name = _os_name
+
     def test_show_formats(self):
         saved = sys.stdout
         sys.stdout = StringIO()

-- 
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list