mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
Issue #20120: Merge from 3.5
This commit is contained in:
commit
4335437506
1 changed files with 19 additions and 0 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue