summaryrefslogtreecommitdiff
path: root/setuptools/tests
diff options
context:
space:
mode:
authorStefan H. Holek <stefan@epy.co.at>2012-10-26 02:10:14 +0200
committerStefan H. Holek <stefan@epy.co.at>2012-10-26 02:10:14 +0200
commit9baf5043290cb6c316c209636652dbb7f0a88abd (patch)
tree2601c6d5b02618900695aa2f08f3fc0bd943e6b8 /setuptools/tests
parentdfef1ac0487dc018b8146b4c414117102ab3b8f1 (diff)
downloadpython-setuptools-bitbucket-9baf5043290cb6c316c209636652dbb7f0a88abd.tar.gz
Make sdist tests pass on Windows.
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_sdist.py27
1 files changed, 19 insertions, 8 deletions
diff --git a/setuptools/tests/test_sdist.py b/setuptools/tests/test_sdist.py
index a3fde026..378015a8 100644
--- a/setuptools/tests/test_sdist.py
+++ b/setuptools/tests/test_sdist.py
@@ -308,12 +308,19 @@ class TestSdistTest(unittest.TestCase):
finally:
unquiet()
- # The filelist should contain the UTF-8 filename
- if sys.version_info >= (3,):
- filename = filename.decode('utf-8')
if sys.platform == 'darwin':
filename = decompose(filename)
- self.assertTrue(filename in cmd.filelist.files)
+
+ if sys.version_info >= (3,):
+ if sys.platform == 'win32':
+ # Python 3 mangles the UTF-8 filename
+ filename = filename.decode('cp1252')
+ self.assertTrue(filename in cmd.filelist.files)
+ else:
+ filename = filename.decode('utf-8')
+ self.assertTrue(filename in cmd.filelist.files)
+ else:
+ self.assertTrue(filename in cmd.filelist.files)
def test_sdist_with_latin1_encoded_filename(self):
# Test for #303.
@@ -332,13 +339,17 @@ class TestSdistTest(unittest.TestCase):
finally:
unquiet()
- # The Latin-1 filename should have been skipped
if sys.version_info >= (3,):
filename = filename.decode('latin-1')
- self.assertFalse(filename in cmd.filelist.files)
+ if sys.platform == 'win32':
+ # Latin-1 is similar to Windows-1252
+ self.assertTrue(filename in cmd.filelist.files)
+ else:
+ # The Latin-1 filename should have been skipped
+ self.assertFalse(filename in cmd.filelist.files)
else:
- # No conversion takes place under Python 2 and the
- # filename is included. We shall keep it that way for BBB.
+ # No conversion takes place under Python 2 and the file
+ # is included. We shall keep it that way for BBB.
self.assertTrue(filename in cmd.filelist.files)