summaryrefslogtreecommitdiff
path: root/setuptools/tests/test_sdist.py
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
commit22882958087e20839daf0139a94f8411d17d6a2c (patch)
treed0774456f30fa471791551bb031bc4fa1a7e832c /setuptools/tests/test_sdist.py
parent383ad7a4f7a1832cf74c250cdae5b63fa4ad61bb (diff)
downloadpython-setuptools-git-22882958087e20839daf0139a94f8411d17d6a2c.tar.gz
Make sdist tests pass on Windows.
--HG-- branch : distribute extra : rebase_source : 9fb51372737224be8d5c50265b04a36f19543572
Diffstat (limited to 'setuptools/tests/test_sdist.py')
-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)