aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-12-14 04:48:26 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-12-14 04:48:26 -0500
commit2f0e172bdab76b0c972b5d1480bcccc88f63c7ec (patch)
tree88b30a827bd8bec4f5761e94a90da7812f38e6a8 /setuptools
parent5eafe7644d18eddd77a5573ecc30b4c98efbb2c6 (diff)
downloadexternal_python_setuptools-2f0e172bdab76b0c972b5d1480bcccc88f63c7ec.tar.gz
external_python_setuptools-2f0e172bdab76b0c972b5d1480bcccc88f63c7ec.tar.bz2
external_python_setuptools-2f0e172bdab76b0c972b5d1480bcccc88f63c7ec.zip
Add test capturing InterpolationSyntaxError on Python 3 and KeyError on Python 2
Diffstat (limited to 'setuptools')
-rw-r--r--setuptools/tests/test_packageindex.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index dcd90d6f..897590e8 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -1,7 +1,11 @@
+from __future__ import absolute_import
+
import sys
+import os
import distutils.errors
from setuptools.compat import httplib, HTTPError, unicode, pathname2url
+from .textwrap import DALS
import pkg_resources
import setuptools.package_index
@@ -201,3 +205,20 @@ class TestContentCheckers:
'http://foo/bar#md5=f12895fdffbd45007040d2e44df98478')
rep = checker.report(lambda x: x, 'My message about %s')
assert rep == 'My message about md5'
+
+
+class TestPyPIConfig:
+ def test_percent_in_password(self, tmpdir, monkeypatch):
+ monkeypatch.setitem(os.environ, 'HOME', str(tmpdir))
+ pypirc = tmpdir / '.pypirc'
+ with pypirc.open('w') as strm:
+ strm.write(DALS("""
+ [pypi]
+ repository=https://pypi.python.org
+ username=jaraco
+ password=pity%
+ """))
+ cfg = setuptools.package_index.PyPIConfig()
+ cred = cfg.creds_by_repository['pypi']
+ assert cred.username == 'jaraco'
+ assert cred.password == 'pity%'