Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4335437

Browse files
committed
Issue #20120: Merge from 3.5
2 parents 1d245fa + c529af3 commit 4335437

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lib/distutils/tests/test_config.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
index-servers =
1717
server1
1818
server2
19+
server3
1920
2021
[server1]
2122
username:me
@@ -26,6 +27,10 @@
2627
password: secret
2728
realm:acme
2829
repository:http://another.pypi/
30+
31+
[server3]
32+
username:cbiggles
33+
password:yh^%#rest-of-my-password
2934
"""
3035

3136
PYPIRC_OLD = """\
@@ -111,6 +116,20 @@ def test_server_empty_registration(self):
111116
finally:
112117
f.close()
113118

119+
def test_config_interpolation(self):
120+
# using the % character in .pypirc should not raise an error (#20120)
121+
self.write_file(self.rc, PYPIRC)
122+
cmd = self._cmd(self.dist)
123+
cmd.repository = 'server3'
124+
config = cmd._read_pypirc()
125+
126+
config = list(sorted(config.items()))
127+
waited = [('password', 'yh^%#rest-of-my-password'), ('realm', 'pypi'),
128+
('repository', 'https://pypi.python.org/pypi'),
129+
('server', 'server3'), ('username', 'cbiggles')]
130+
self.assertEqual(config, waited)
131+
132+
114133
def test_suite():
115134
return unittest.makeSuite(PyPIRCCommandTestCase)
116135

0 commit comments

Comments
 (0)