summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2016-06-20 18:42:05 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2016-06-20 18:42:05 (GMT)
commit43354375063662deda272b9a2d64cf53d6b748f3 (patch)
tree4d234955a28b3ccc3a908b40bb048e5f2498e9c2
parent1d245fabaf975e187fa25689bfd8fccf7b5dbfdc (diff)
parentc529af3fcb2c1a48780f66291970f4527659fa30 (diff)
downloadcpython-43354375063662deda272b9a2d64cf53d6b748f3.zip
cpython-43354375063662deda272b9a2d64cf53d6b748f3.tar.gz
cpython-43354375063662deda272b9a2d64cf53d6b748f3.tar.bz2
Issue #20120: Merge from 3.5
-rw-r--r--Lib/distutils/tests/test_config.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_config.py b/Lib/distutils/tests/test_config.py
index d91dedd..1aacb73 100644
--- a/Lib/distutils/tests/test_config.py
+++ b/Lib/distutils/tests/test_config.py
@@ -16,6 +16,7 @@ PYPIRC = """\
index-servers =
server1
server2
+ server3
[server1]
username:me
@@ -26,6 +27,10 @@ username:meagain
password: secret
realm:acme
repository:http://another.pypi/
+
+[server3]
+username:cbiggles
+password:yh^%#rest-of-my-password
"""
PYPIRC_OLD = """\
@@ -111,6 +116,20 @@ class PyPIRCCommandTestCase(support.TempdirManager,
finally:
f.close()
+ def test_config_interpolation(self):
+ # using the % character in .pypirc should not raise an error (#20120)
+ self.write_file(self.rc, PYPIRC)
+ cmd = self._cmd(self.dist)
+ cmd.repository = 'server3'
+ config = cmd._read_pypirc()
+
+ config = list(sorted(config.items()))
+ waited = [('password', 'yh^%#rest-of-my-password'), ('realm', 'pypi'),
+ ('repository', 'https://pypi.python.org/pypi'),
+ ('server', 'server3'), ('username', 'cbiggles')]
+ self.assertEqual(config, waited)
+
+
def test_suite():
return unittest.makeSuite(PyPIRCCommandTestCase)