summaryrefslogtreecommitdiff
path: root/tests/test_upload.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-12-21 00:02:20 +0000
committerTarek Ziadé <ziade.tarek@gmail.com>2009-12-21 00:02:20 +0000
commit7553531b1974c77b2c51f9e22aaaa36eab115b39 (patch)
tree648dee6ddd3028902cfbc5eced01368451b38d6b /tests/test_upload.py
parent53e5b86d24ea8f12522a35ff9bf5767724d16938 (diff)
downloadpython-setuptools-git-7553531b1974c77b2c51f9e22aaaa36eab115b39.tar.gz
Merged revisions 76952 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76952 | tarek.ziade | 2009-12-21 00:23:34 +0100 (Mon, 21 Dec 2009) | 1 line Fixed #7552: fixed distutils.command.upload failure on very long passwords ........
Diffstat (limited to 'tests/test_upload.py')
-rw-r--r--tests/test_upload.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/test_upload.py b/tests/test_upload.py
index 92818858..979ab228 100644
--- a/tests/test_upload.py
+++ b/tests/test_upload.py
@@ -10,6 +10,25 @@ from distutils.core import Distribution
from distutils.tests import support
from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase
+PYPIRC_LONG_PASSWORD = """\
+[distutils]
+
+index-servers =
+ server1
+ server2
+
+[server1]
+username:me
+password:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+[server2]
+username:meagain
+password: secret
+realm:acme
+repository:http://another.pypi/
+"""
+
+
PYPIRC_NOPASSWORD = """\
[distutils]
@@ -85,7 +104,7 @@ class uploadTestCase(PyPIRCCommandTestCase):
self.write_file(path)
command, pyversion, filename = 'xxx', '2.6', path
dist_files = [(command, pyversion, filename)]
- self.write_file(self.rc, PYPIRC)
+ self.write_file(self.rc, PYPIRC_LONG_PASSWORD)
# lets run it
pkg_dir, dist = self.create_dist(dist_files=dist_files)
@@ -101,6 +120,8 @@ class uploadTestCase(PyPIRCCommandTestCase):
self.assertEquals(self.last_open.req.get_full_url(),
'http://pypi.python.org/pypi')
self.assertTrue(b'xxx' in self.last_open.req.data)
+ auth = self.last_open.req.headers['Authorization']
+ self.assertFalse('\n' in auth)
def test_suite():
return unittest.makeSuite(uploadTestCase)