summaryrefslogtreecommitdiff
path: root/setuptools/tests/test_sdist.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-05-17 11:38:50 -0400
committerJason R. Coombs <jaraco@jaraco.com>2014-05-17 11:38:50 -0400
commit1535176abf75113e2b749bbccaca999d71697f7a (patch)
treea27244a55ddbf01f3f3d4b43b8b8e2abc53f5de8 /setuptools/tests/test_sdist.py
parent98252c9624c564444307544bf77c7aa3828aa024 (diff)
parent7192c0fb9e77a8ffa8f54b956cb6775ecb3b1795 (diff)
downloadpython-setuptools-git-1535176abf75113e2b749bbccaca999d71697f7a.tar.gz
Merge changes from Pull Request 50
Diffstat (limited to 'setuptools/tests/test_sdist.py')
-rw-r--r--setuptools/tests/test_sdist.py23
1 files changed, 16 insertions, 7 deletions
diff --git a/setuptools/tests/test_sdist.py b/setuptools/tests/test_sdist.py
index ec940d00..cc426f66 100644
--- a/setuptools/tests/test_sdist.py
+++ b/setuptools/tests/test_sdist.py
@@ -156,10 +156,11 @@ class TestSdistTest(unittest.TestCase):
self.fail(e)
# The manifest should contain the UTF-8 filename
- if sys.version_info >= (3,):
- self.assertTrue(posix(filename) in u_contents)
- else:
- self.assertTrue(posix(filename) in contents)
+ if sys.version_info < (3,):
+ fs_enc = sys.getfilesystemencoding()
+ filename = filename.decode(fs_enc)
+
+ self.assertTrue(posix(filename) in u_contents)
# Python 3 only
if sys.version_info >= (3,):
@@ -401,9 +402,17 @@ class TestSdistTest(unittest.TestCase):
filename = filename.decode('latin-1')
self.assertFalse(filename in cmd.filelist.files)
else:
- # 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)
+ # Under Python 2 there seems to be no decoded string in the
+ # filelist. However, due to decode and encoding of the
+ # file name to get utf-8 Manifest the latin1 maybe excluded
+ try:
+ # fs_enc should match how one is expect the decoding to
+ # be proformed for the manifest output.
+ fs_enc = sys.getfilesystemencoding()
+ filename.decode(fs_enc)
+ self.assertTrue(filename in cmd.filelist.files)
+ except UnicodeDecodeError:
+ self.assertFalse(filename in cmd.filelist.files)
class TestDummyOutput(environment.ZippedEnvironment):